diff options
Diffstat (limited to 'js/components/groupList/groupList_controller.js')
-rw-r--r-- | js/components/groupList/groupList_controller.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/js/components/groupList/groupList_controller.js b/js/components/groupList/groupList_controller.js deleted file mode 100644 index 08bde897..00000000 --- a/js/components/groupList/groupList_controller.js +++ /dev/null @@ -1,40 +0,0 @@ -angular.module('contactsApp') -.controller('grouplistCtrl', function($scope, $timeout, ContactService, SearchService, $routeParams) { - var ctrl = this; - - ctrl.groups = []; - ctrl.contactFilters = []; - - ContactService.getGroupList().then(function(groups) { - ctrl.groups = groups; - }); - - ContactService.getContactFilters().then(function(contactFilters) { - ctrl.contactFilters = contactFilters; - }); - - ctrl.getSelected = function() { - return $routeParams.gid; - }; - - // Update groupList on contact add/delete/update/groupsUpdate - ContactService.registerObserverCallback(function(ev) { - if (ev.event !== 'getFullContacts') { - $timeout(function () { - $scope.$apply(function() { - ContactService.getGroupList().then(function(groups) { - ctrl.groups = groups; - }); - ContactService.getContactFilters().then(function(contactFilters) { - ctrl.contactFilters = contactFilters; - }); - }); - }); - } - }); - - ctrl.setSelected = function (selectedGroup) { - SearchService.cleanSearch(); - $routeParams.gid = selectedGroup; - }; -}); |