contacts/js/components/contactList/contactList_controller.js

22 lines
503 B
JavaScript
Raw Normal View History

2016-02-17 21:34:36 +00:00
app.controller('contactlistCtrl', ['$scope', 'ContactService', '$routeParams', function($scope, ContactService, $routeParams) {
2015-10-27 17:52:09 +00:00
var ctrl = this;
2015-12-08 11:31:43 +00:00
2016-02-17 21:34:36 +00:00
$scope.gid = $routeParams.gid;
2016-02-11 14:30:52 +00:00
ContactService.registerObserverCallback(function(contacts) {
$scope.$apply(function() {
ctrl.contacts = contacts;
});
});
ContactService.getAll().then(function(contacts) {
$scope.$apply(function(){
ctrl.contacts = contacts;
});
});
ctrl.createContact = function() {
2016-02-11 14:30:52 +00:00
ContactService.create();
2016-01-14 10:40:45 +00:00
};
2015-12-08 11:31:43 +00:00
}]);