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=========================================================
20 var editEnforcerTypeController = function ($scope, $modalInstance, message, UserInfoServiceDS2){
21 if(message.enforcerDictionaryData==null)
22 $scope.label='Add Enforcing Type'
24 $scope.label='Edit Enforcing Type'
25 $scope.disableCd=true;
27 $scope.editEnforcerType = message.enforcerDictionaryData;
29 /*getting user info from session*/
31 UserInfoServiceDS2.getFunctionalMenuStaticDetailSession()
32 .then(function (response) {
33 userid = response.userid;
36 $scope.saveEnforcerType = function(enforcerDictionaryData) {
37 var uuu = "saveDictionary/enforcer_dictionary/save_enforcerType";
38 var postData={enforcerDictionaryData: enforcerDictionaryData, userid: userid};
43 contentType: 'application/json',
44 data: JSON.stringify(postData),
45 success : function(data){
46 $scope.$apply(function(){
47 $scope.enforcerDictionaryDatas=data.enforcerDictionaryDatas;});
48 console.log($scope.enforcerDictionaryDatas);
49 $modalInstance.close({enforcerDictionaryDatas:$scope.enforcerDictionaryDatas});
51 error : function(data){
52 alert("Error while saving.");
57 $scope.close = function() {
58 $modalInstance.close();