2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
23 var editEnforcerTypeController = function ($scope, $modalInstance, message, PapUrlService, UserInfoService){
24 if(message.enforcerDictionaryData==null)
25 $scope.label='Add Enforcing Type'
27 $scope.label='Edit Enforcing Type'
28 $scope.disableCd=true;
30 $scope.editEnforcerType = message.enforcerDictionaryData;
33 PapUrlService.getPapUrl().then(function(data) {
35 papUrl = config.PAP_URL;
39 /*getting user info from session*/
41 UserInfoService.getFunctionalMenuStaticDetailSession()
42 .then(function (response) {
43 loginId = response.userid;
46 $scope.saveEnforcerType = function(enforcerDictionaryData) {
47 var uuu = papUrl + "/ecomp/enforcer_dictionary/save_enforcerType.htm";
48 var postData={enforcerDictionaryData: enforcerDictionaryData, loginId: loginId};
53 contentType: 'application/json',
54 data: JSON.stringify(postData),
55 success : function(data){
56 $scope.$apply(function(){
57 $scope.enforcerDictionaryDatas=data.enforcerDictionaryDatas;});
58 console.log($scope.enforcerDictionaryDatas);
59 $modalInstance.close({enforcerDictionaryDatas:$scope.enforcerDictionaryDatas});
61 error : function(data){
62 alert("Error while saving.");
67 $scope.close = function() {
68 $modalInstance.close();