OSDN Git Service

[Develop ang manual test] TagFilter at SelectCommand Modal
[eos/zephyr.git] / front-end / app / scripts / controllers / SelectCommand.ts
1 namespace app.controllers {
2     export class SelectCommand{ 
3
4         public static $inject = ['$scope', 'APIEndPoint'];
5         private tags: string[];
6         private commands: string[];
7         private searchText: string;
8         private currentTag: string;
9
10         constructor($scope: ng.IScope, private APIEndPoint: services.APIEndPoint) {
11             var controller = this;
12             this.APIEndPoint
13                 .getTags()
14                 .$promise.then((result) => {
15                    controller.tags = result.info; 
16                 });
17
18             this.APIEndPoint
19                 .getCommands()
20                 .$promise.then((result) => {
21                    controller.commands = result.info; 
22                 });
23             this.currentTag = 'all';
24
25         } 
26
27         private changeTag(tag: string) {
28             this.currentTag = tag;
29         }
30     }
31 }