I've put together a Plunker example illustrating the issue I'm facing with my app.
Here's a brief overview of the scenario:
- A controller loads a list of transactions (objects of type Transaction) into the $scope
- This controller listens for an event triggered by a service responsible for persisting new or updated Transaction objects, then refreshes the model
- The view uses ng-repeat to display the transaction list
- Each transaction can be individually updated (committed or rolled back)
- The AngularJS app has a run() function that generates a new Transaction object every 2 seconds, simulating external data coming in (e.g., from an $http request to a server)
One thing you'll notice is that the view doesn't update when the model gets reassigned with a new list of objects after receiving the service's event.
I've been struggling with this issue for the past two days. The usual culprit for this behavior is manipulating the model outside of AngularJS without invoking $apply(), but I don't think that's the case here.
I've also checked $scope.$$phase and manually called $apply or $digest (although not recommended) without any luck.
Could it be something I'm overlooking? Is it a bug? Any other approach I could try?