The view is not updated in AngularJS
You are missing $scope.$apply(). Whenever you touch anything from outside of the Angular world, you need to call $apply, to notify Angular. That might be from: xhr callback (handled by $http service) setTimeout callback (handled by $defer service) DOM Event callback (handled by directives) In your case, do something like this: // inject $rootScope and … Read more