contacts/js/components/groupList/groupList_controller.js

14 lines
452 B
JavaScript
Raw Normal View History

2016-02-18 16:58:00 +00:00
app.controller('grouplistCtrl', ['$scope', 'ContactService', '$routeParams', function($scope, ContactService, $routeParams) {
2016-02-12 12:48:46 +00:00
2016-02-29 12:43:05 +00:00
$scope.groups = [t('contacts', 'All contacts')];
2016-02-12 12:48:46 +00:00
ContactService.getGroups().then(function(groups) {
$scope.groups = _.unique([t('contacts', 'All contacts')].concat(groups));
2016-02-12 12:48:46 +00:00
});
2016-02-18 16:58:00 +00:00
$scope.selectedGroup = $routeParams.gid;
2016-02-18 16:31:46 +00:00
$scope.setSelected = function (selectedGroup) {
$scope.selectedGroup = selectedGroup;
};
2016-02-12 12:48:46 +00:00
}]);