From 204b88bda2339b3a395ea35bb5b7d500891527b7 Mon Sep 17 00:00:00 2001 From: guangxingwang Date: Tue, 13 Feb 2018 13:25:42 -0600 Subject: [PATCH] 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 --- .../PolicyTemplateController/DCAEMicroServicePolicyController.js | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.16.6