Timeout fix

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2017-08-10 15:39:59 +02:00
parent c5498b0cd5
commit 4237fb27eb
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
1 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
angular.module('contactsApp')
.controller('grouplistCtrl', function($scope, ContactService, SearchService, $routeParams) {
.controller('grouplistCtrl', function($scope, $timeout, ContactService, SearchService, $routeParams) {
var ctrl = this;
ctrl.groups = [];
@ -15,11 +15,11 @@ angular.module('contactsApp')
// Update groupList on contact add/delete/update
ContactService.registerObserverCallback(function(ev) {
if (ev.event !== 'getFullContacts') {
$scope.$apply(function() {
$timeout(function () { $scope.$apply(function() {
ContactService.getGroupList().then(function(groups) {
ctrl.groups = groups;
});
});
}); });
}
});