Try an explicit view:
$scope.$watch(function() { return SharedData.getContacts(); }, function(newContacts) { // Do something with newContacts. });
If the elements of the collection can change without changing the entire identifier of the collection object (I assume Array or Object ), you need to use $scope.$watchCollection , although this is much slower than regular $watch , so avoid if you can change the entire collection immediately.
Note that a design may be nicer to expose a function to an area that simply returns current contacts:
$scope.getContacts = function() { return SharedData.getContacts(); };
If you need a notification in SharedData , you can enter $rootScope into it and put $watch on it.
source share