I have a service, say:
factory(\'aService\', [\'$rootScope\', \'$resource\', function ($rootScope, $resource) {
var service = {
foo: []
};
return
For those like me just looking for a simple solution, this does almost exactly what you expect from using normal $watch in controllers. The only difference is, that it evaluates the string in it's javascript context and not on a specific scope. You'll have to inject $rootScope into your service, although it is only used to hook into the digest cycles properly.
function watch(target, callback, deep) {
$rootScope.$watch(function () {return eval(target);}, callback, deep);
};