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) {
|
2016-03-07 17:07:15 +00:00
|
|
|
$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
|
|
|
}]);
|