OSDN Git Service

Merge branch 'master' of git.osdn.net:/gitroot/eos/zephyr
[eos/zephyr.git] / front-end / app / scripts / directives / Option.ts
1 namespace app.directives {
2 <<<<<<< HEAD
3   export class Option implements ng.IDirective {
4
5     public restrict: string;
6     public replace: boolean;
7     public templateUrl: string;
8     public bindToController: Object;
9     public controller: string;
10     public controllerAs: string;
11     public scope: boolean;
12
13     /**
14     * constructor
15     *
16     * @param
17     */
18     constructor() {
19       this.restrict = 'E';
20       this.replace = true;
21       this.controller = 'optionController';
22       this.bindToController = {
23         info: '=',
24         files: '='
25       };
26       this.scope = true;
27       this.templateUrl = 'templates/option.html';
28       this.controllerAs = 'ctrl';
29     }
30
31     /**
32     * instance生成
33     * @returns {function(): HeaderMenu}
34     * @constructor
35     */
36     public static Factory(): ng.IDirectiveFactory {
37       var directive = () => {
38         return new Option();
39       };
40       directive.$inject = [];
41       return directive;
42     }
43   }
44
45   export class OptionController {
46
47     public static $inject = [];
48
49     private info: declares.IOption;
50
51     constructor() {
52       var controller = this;
53
54       // データバインディングしているarg.inputに
55       // OptionControlFileに記された初期値(arg.initialValue)を代入
56       angular.forEach(controller.info.arg, (arg) => {
57         if(arg.initialValue) {
58           if(arg.formType === 'number') {
59             arg.input = parseInt(arg.initialValue);
60           } else {
61             arg.input = arg.initialValue;
62           }
63         }
64       });
65     }
66   }
67 =======
68     export class Option implements ng.IDirective {
69
70         public restrict: string;
71         public replace: boolean;
72         public templateUrl: string;
73         public bindToController: Object;
74         public controller: string;
75         public controllerAs: string;
76         public scope: boolean;
77
78         /** 
79          * constructor
80          *
81          * @param
82          */
83         constructor() {
84             this.restrict = 'E';
85             this.replace = true;
86             this.controller = 'optionController';
87             this.bindToController = {
88                 info: '=',
89                 files: '='
90             };
91             this.scope = true;
92             this.templateUrl = 'templates/option.html';
93             this.controllerAs = 'ctrl';
94         }
95
96         /**
97          * instance生成
98          * @returns {function(): HeaderMenu}
99          * @constructor
100          */
101         public static Factory(): ng.IDirectiveFactory {
102             var directive = () => {
103             return new Option();
104             };
105             directive.$inject = [];
106             return directive;
107         }
108     }
109
110     export class OptionController {
111
112         public static $inject = [];
113
114         private info: declares.IOption;
115
116         constructor() {
117             var controller = this;
118
119             // データバインディングしているarg.inputに
120             // OptionControlFileに記された初期値(arg.initialValue)を代入
121             angular.forEach(controller.info.arg, (arg) => {
122                 if(arg.initialValue) {
123                     if(arg.formType === 'number') {
124                         arg.input = parseInt(arg.initialValue);
125                     } else {
126                         arg.input = arg.initialValue;
127                     }
128                 }
129             });
130         }
131     } 
132 >>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
133 }