1 namespace app.directives {
2 export class Option implements ng.IDirective {
4 public restrict: string;
5 public replace: boolean;
6 public templateUrl: string;
7 public bindToController: Object;
8 public controller: string;
9 public controllerAs: string;
10 public scope: boolean;
20 this.controller = 'optionController';
21 this.bindToController = {
26 this.templateUrl = 'templates/option.html';
27 this.controllerAs = 'ctrl';
32 * @returns {function(): HeaderMenu}
35 public static Factory(): ng.IDirectiveFactory {
36 var directive = () => {
39 directive.$inject = [];
44 export class OptionController {
46 public static $inject = [];
48 private info: declares.IOption;
51 var controller = this;
53 // データバインディングしているarg.inputに
54 // OptionControlFileに記された初期値(arg.initialValue)を代入
55 angular.forEach(controller.info.arg, (arg) => {
56 if(arg.initialValue) {
57 if(arg.formType === 'number') {
58 arg.input = parseInt(arg.initialValue);
60 arg.input = arg.initialValue;