I'm curious if I can use the $watch function to detect changes in the database that are not initiated by the user's actions on their current page.
For instance, within the controller:
.MesgCtrl(...)
$scope.data = {'name': 'Tim', 'visits': 0};
$scope.$watch('data', function(newValue, oldValue) {
console.log("$watch triggered");
});
And in the template.html:
<ul ng-repeat="d in data">
<li>{{d}}</li>
</ul>
A different REST endpoint URL receives POST requests for visits and updates them in the database when they occur. I want the visit counts to also update in template.html without any action from the user, but so far I've only been successful in using $watch when calling $resource.save() to update visits from the same AngularJS Controller URL, not a different one.