OSDN Git Service

Modified: Upload, Command execution
[eos/zephyr.git] / front-end / app / scripts / directives / Upload.ts
1 namespace app.directives {
2     export class Upload implements ng.IDirective {
3
4       public restrict: string;
5       public replace: boolean;
6       public templateUrl: string;
7       public scope: boolean;
8       public controller: string;
9       public controllerAs: string;
10       public bindToController: Object;
11
12         /**
13          * constructor
14          * @param
15          */
16       constructor() {
17         this.restrict = 'E';
18         this.replace = true;
19         this.scope = true;
20         this.controller = 'UploadController';
21         this.controllerAs = 'ctrl';
22         this.bindToController = {
23                 index: '=',
24                 name: '=',
25                 remove: '&',
26                 list: '='
27         };
28         this.templateUrl = 'templates/upload.html';
29         console.log("templates/upload.html-constructor");
30     }
31
32     /**
33          * instance生成
34          * @returns {function(): HeaderMenu}
35          * @constructor
36     */
37     public static Factory(): ng.IDirectiveFactory {
38         var directive = () => {
39           return new Upload();
40         };
41         directive.$inject = [];
42           return directive;
43     }
44 }
45
46 export class UploadController {
47     public static $inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
48
49     // From parent directive bindToController property
50     private index: string;
51     private name: string;
52     private remove: Function;
53     private workspace: declares.IFileInfo;
54
55         // property of ui.bootstrap uib-accordion directive
56     private isOpen: boolean;
57     private heading: string;
58
59         // property about Option directive
60     private files: any;
61     private options: declares.IOption[];
62     private dirs: any;
63     private messages: any;
64
65     private uuid: string; // uuid of Instance of Command directive
66
67     constructor(private APIEndPoint: services.APIEndPoint,
68         private $scope: ng.IScope,
69         private MyModal: services.MyModal,
70         private WebSocket: services.WebSocket,
71         private $window: ng.IWindowService,
72         private $rootScope: ng.IRootScopeService,
73         private Console: services.Console
74         ) {
75             var controller = this;
76             console.log("directive.upload-constructor");
77
78             //this.APIEndPoint
79             //this.APIEndPoint
80             //.upload()
81             //.then((result) => {
82             //    console.log(result);
83             //})
84     }
85
86     public submit() {
87         console.log("submit: function not supported¥n")
88     }
89   }
90 }