From d182202fc6001983541504ed323d68479086317e Mon Sep 17 00:00:00 2001 From: WuKong Date: Sat, 22 Apr 2017 13:25:07 +0200 Subject: add moonv4 Change-Id: I247af788d0b0fb961fbc85416486b241eb1d807c Signed-off-by: WuKong --- .../metarules/action/metarules.controller.edit.js | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 moonv4/moon_gui/static/app/model/edit/metarules/action/metarules.controller.edit.js (limited to 'moonv4/moon_gui/static/app/model/edit/metarules/action/metarules.controller.edit.js') diff --git a/moonv4/moon_gui/static/app/model/edit/metarules/action/metarules.controller.edit.js b/moonv4/moon_gui/static/app/model/edit/metarules/action/metarules.controller.edit.js new file mode 100644 index 00000000..b2ebc45d --- /dev/null +++ b/moonv4/moon_gui/static/app/model/edit/metarules/action/metarules.controller.edit.js @@ -0,0 +1,49 @@ +(function() { + + 'use strict'; + + angular + .module('moon') + .controller('MetaRulesEditController', MetaRulesEditController); + + MetaRulesEditController.$inject = ['$scope', '$rootScope']; + + function MetaRulesEditController($scope, $rootScope) { + + var edit = this; + + edit.metaRule = $scope.metaRule; + + activate(); + + function activate(){ + } + + + /* + * ---- events + */ + var rootListeners = { + + 'event:metaRuleBasicUpdatedSuccess': $rootScope.$on('event:metaRuleBasicUpdatedSuccess', metaRuleUpdatedSuccess) + + }; + + for (var unbind in rootListeners) { + $scope.$on('$destroy', rootListeners[unbind]); + } + + /** + * When the MetaRule is updated, this function refresh the current metaRule with the new changes + * @param event + * @param metaRule + */ + function metaRuleUpdatedSuccess(event, metaRule){ + + edit.metaRule = metaRule; + + } + + } + +})(); -- cgit 1.2.3-korg