[VID-6] Initial rebase push
[vid.git] / vid-app-common / src / main / webapp / app / vid / scripts / controller / VidApp.js
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * VID\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 (function () {\r
22   'use strict';\r
23   \r
24   appDS2.config(['$routeProvider', '$locationProvider', function ($routeProvider) {\r
25       $routeProvider\r
26         .when('/models/services', {\r
27           controller: 'ServiceModelController',\r
28           templateUrl: 'app/vid/scripts/view-models/serviceModels.htm'\r
29         })\r
30         .when('/models/services/createInstance', {\r
31           controller: 'aaiSubscriberController',\r
32           templateUrl: 'app/vid/scripts/view-models/createInstanceServiceModels.htm'\r
33         })\r
34         .when('/instances/services', {\r
35                 templateUrl : "app/vid/scripts/view-models/aaiGetSubs.htm", \r
36                 controller : "aaiSubscriberController"\r
37         })\r
38         .when('/instances/subscribers', {\r
39                 templateUrl : "app/vid/scripts/view-models/aaiGetSubscriberList.htm", \r
40                 controller : "aaiSubscriberController"\r
41         })\r
42         .when('/instances/serviceTypes', {\r
43                 templateUrl : "app/vid/scripts/view-models/aaiServiceTypes.htm", \r
44                 controller : "aaiSubscriberController"\r
45         })\r
46         .when('/instances/subdetails', {\r
47                 templateUrl : "app/vid/scripts/view-models/aaiSubDetails.htm", \r
48                 controller : "aaiSubscriberController"\r
49         })\r
50         .when('/instantiate', {\r
51           controller: 'InstantiationController',\r
52           templateUrl: 'app/vid/scripts/view-models/instantiate.htm'\r
53         })\r
54         .otherwise({\r
55                 redirectTo: '/models/services'\r
56         });\r
57     }]);\r
58   \r
59   appDS2.service('vidService', function() {\r
60           var _model = undefined;\r
61           var _instance = undefined;\r
62           \r
63           this.setModel = function(model) {\r
64                   _model = model;\r
65           };\r
66           \r
67           this.getModel = function() {\r
68                   return _model;\r
69           };\r
70           \r
71           this.setInstance = function(instance) {\r
72                   _instance = instance;\r
73           };\r
74           \r
75           this.getInstance = function() {\r
76                   return _instance;\r
77           };\r
78   });\r
79 })();\r