From: guangxingwang Date: Tue, 13 Feb 2018 19:25:42 +0000 (-0600) Subject: Fix a Bug on Editor Screen X-Git-Tag: v1.2.0~144^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=commitdiff_plain;h=204b88bda2339b3a395ea35bb5b7d500891527b7 Fix a Bug on Editor Screen On editor screen, sometimes click on + button only one click, it creates more than text fields Issue-ID: POLICY-629 Change-Id: I9acc95fa0a4a7df3828e579f994c06bfa3199eb5 Signed-off-by: guangxingwang --- diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js index 6f316c1e3..101366400 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js @@ -438,6 +438,13 @@ angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$wind } //After initially create the edit template, reset it to false. $scope.isInitEditTemplate = false; + if($scope.temp.policy.editPolicy){ + //reset it to false since the template has been created + $scope.temp.policy.editPolicy = false; + //clean all the events of addNewChoice + $scope.$on('$destroy', addNewChoice); + } + } var ele = angular.element(document.getElementById("DynamicTemplate")); $compile(ele.contents())($scope);