I have a service, say:
factory(\'aService\', [\'$rootScope\', \'$resource\', function ($rootScope, $resource) {
var service = {
foo: []
};
return
I've seen some terrible observer patterns here that cause memory leaks on large applications.
I might be a little late but it's as simple as this.
The watch function watches for reference changes (primitive types) if you want to watch something like array push simply use:
someArray.push(someObj); someArray = someArray.splice(0);
This will update the reference and update the watch from anywhere. Including a services getter method. Anything that's a primitive will be updated automatically.