managing scope objects populated from remote services in angular js

98 views Asked by At

I have a function that saves a person object to a database from controller A. When the person service returns a successful promise I emit a "personListUpdated" event up to $rootScope where controller B is listening for this event. When its received with (see code below) the view doesnt reflect the changes made to the model. I imagine there is a good reason for this, I just dont know what it is.

$rootScope.$on('personListUpdated' function() {   
    PersonService.getAllPeople().then(function(people) {
        $scope.people = people;
     })
}); 
0

There are 0 answers