Yangman - changed event strings to constants
[dlux.git] / modules / yangman-resources / src / main / resources / yangman / controllers / modules-list.controller.js
index 470c5c93ab0d7a8d37bad5d0bf88f4317e9704c1..c686d3459a4b3ed22854ef72ca83151daaf43f6d 100644 (file)
@@ -6,9 +6,9 @@ define([
     angular.module('app.yangman').controller('ModulesListCtrl', ModulesListCtrl);
 
     ModulesListCtrl.$inject = ['$scope', '$rootScope', '$mdToast', 'YangUtilsService', 'PluginsHandlerService',
-                                '$filter', '$timeout'];
+                                '$filter', '$timeout', 'constants'];
 
-    function ModulesListCtrl($scope, $rootScope, $mdToast, YangUtilsService, PluginsHandlerService, $filter, $timeout) {
+    function ModulesListCtrl($scope, $rootScope, $mdToast, YangUtilsService, PluginsHandlerService, $filter, $timeout, constants) {
         var modulesList = this;
 
         modulesList.treeApis = [];
@@ -24,29 +24,29 @@ define([
         modulesList.setModule = setModule;
 
         // watchers
-        $scope.$on('YANGMAN_GET_API_TREE_DATA', function (event, args) {
+        $scope.$on(constants.YANGMAN_GET_API_TREE_DATA, function (event, args) {
             (args.cbk || angular.noop)(modulesList.treeApis);
         });
 
         // set tree apis data
-        $scope.$on('YANGMAN_SET_API_TREE_DATA', function (event, args) {
+        $scope.$on(constants.YANGMAN_SET_API_TREE_DATA, function (event, args) {
             modulesList.treeApis = args.params;
             modulesList.showLoadingBox = false;
             showToastInfoBox('YANGMAN_LOADED_MODULES');
         });
 
         // show hide loading box
-        $scope.$on('YANGMAN_SET_LOADING_BOX', function (event, args){
+        $scope.$on(constants.YANGMAN_SET_LOADING_BOX, function (event, args){
             modulesList.showLoadingBox = args.params;
             (args.cbk || angular.noop)();
         });
 
         // show info box with custom title
-        $scope.$on('YANGMAN_SHOW_TOAST', function (event, args) {
+        $scope.$on(constants.YANGMAN_SHOW_TOAST, function (event, args) {
             showToastInfoBox(args.params);
         });
 
-        $scope.$on('YANGMAN_SET_MODULE_LIST_TITLE', function (event, args) {
+        $scope.$on(constants.YANGMAN_SET_MODULE_LIST_TITLE, function (event, args) {
             modulesList.moduleListTitle = args.params;
         });