1 namespace app.controllers {
2 export class Execution {
4 public static $inject = ['MyModal', '$scope'];
6 public commandInfoList: declares.CommandInfo[];
10 constructor(private MyModal: services.MyModal, private $scope: ng.IScope) {
11 this.commandInfoList = [];
15 // close all <uib-accordion> tag
16 this.$scope.$broadcast('close');
17 var commandInfoList = this.commandInfoList;
19 // add <command> directive
20 var commandInstance = this.MyModal.selectCommand();
23 .then(function(command) {
24 commandInfoList.push(new declares.CommandInfo(command));
29 var result = this.MyModal.open('SelectCommand');
33 public remove(index: number, list: declares.CommandInfo[]) {
34 list.splice(index, 1);
37 * Commandディレクティブから実行する際にはExecution.commandInfoListの参照を取得できない。
38 * ディレクティブ経由でExecution.commandInfoListの参照を取得。
39 * this.commandInfoList.splice(index, 1);
41 * thisがremoveの呼び出し元となるため。