org.onap migration
[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('/change-management', {\r
51               templateUrl : "app/vid/scripts/view-models/change-management.html",\r
52               controller : "changeManagementController",\r
53                           controllerAs: 'vm'\r
54                 })\r
55                 .when('/testEnvironments', {\r
56               templateUrl : "app/vid/scripts/view-models/testEnvironments.htm",\r
57               controller : "testEnvironmentsController",\r
58               controllerAs: 'vm'\r
59                 })\r
60         .when('/instantiate', {\r
61           controller: 'InstantiationController',\r
62           templateUrl: 'app/vid/scripts/view-models/instantiate.htm'\r
63         })\r
64             .when('/addNetworkNode', {\r
65                   controller: 'AddNetworkNodeController',\r
66                   templateUrl: 'app/vid/scripts/view-models/addNetworkNode.htm'\r
67                 })\r
68         .when('/pnfSearchAssociation', {\r
69                         controller: 'pnfSearchAssociationController',\r
70                         templateUrl: 'app/vid/scripts/view-models/pnfSearchAssociation.htm'\r
71          })\r
72             .when('/serviceProxyConfig', {\r
73                   controller: 'ServiceProxyConfigController',\r
74                   templateUrl: 'app/vid/scripts/view-models/serviceProxyConfig.htm'\r
75             })\r
76         .otherwise({\r
77                 redirectTo: '/models/services'\r
78         });\r
79     }]);\r
80   \r
81   appDS2.service('vidService', function() {\r
82           var _model = undefined;\r
83           var _instance = undefined;\r
84           \r
85           this.setModel = function(model) {\r
86                   _model = model;\r
87           };\r
88           \r
89           this.getModel = function() {\r
90                   return _model;\r
91           };\r
92           \r
93           this.setInstance = function(instance) {\r
94                   _instance = instance;\r
95           };\r
96           \r
97           this.getInstance = function() {\r
98                   return _instance;\r
99           };\r
100   });\r
101 })();\r