OSDN Git Service

Merge branch 'master' of git.osdn.net:/gitroot/eos/zephyr
[eos/zephyr.git] / front-end / app / scripts / services / MyModal.ts
1 namespace app.services {
2     export class MyModal {
3
4         private $uibModal: ng.ui.bootstrap.IModalService;
5         private modalOption: ng.ui.bootstrap.IModalSettings;
6         public static $inject = ['$uibModal'];
7
8 <<<<<<< HEAD
9         constructor($uibModal: ng.ui.bootstrap.IModalService) {
10 =======
11         constructor($uibModal: ng.ui.bootstrap.IModalService) { 
12 >>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
13             this.$uibModal = $uibModal;
14             this.modalOption = {
15                 backdrop: true,
16                 controller: null,
17                 templateUrl: null,
18                 size: null
19             }
20         }
21
22         public open(modalName: string): ng.ui.bootstrap.IModalServiceInstance {
23         //public open(modalName: string): string {
24             if(modalName === 'SelectCommand') {
25                //this.modalOption.controller = 'SelectCommandController';
26                this.modalOption.templateUrl = 'templates/select-command.html';
27                this.modalOption.size = 'lg';
28            }
29            return this.$uibModal.open(this.modalOption);
30
31            //return modalName;
32         }
33
34         public selectCommand(): ng.ui.bootstrap.IModalServiceInstance {
35             this.modalOption.templateUrl = 'templates/select-command.html';
36             this.modalOption.controller = 'selectCommandController';
37             this.modalOption.controllerAs = 'c';
38             this.modalOption.size = 'lg';
39             return this.$uibModal.open(this.modalOption);
40         }
41
42         public preview(): ng.ui.bootstrap.IModalServiceInstance {
43             this.modalOption.templateUrl = 'templates/preview.html';
44             this.modalOption.controller = 'previewController';
45             this.modalOption.controllerAs = 'c';
46             this.modalOption.size = 'lg';
47             return this.$uibModal.open(this.modalOption);
48         }
49
50 <<<<<<< HEAD
51         public upload(): ng.ui.bootstrap.IModalServiceInstance {
52           this.modalOption.templateUrl = 'templates/upload.html';
53           this.modalOption.controller = 'uploadController';
54           this.modalOption.controllerAs ='c';
55           this.modalOption.size = 'lg';
56           return this.$uibModal.open(this.modalOption);
57         }
58
59 =======
60 >>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
61     }
62 }