I can set up a $watch on an AngularJS scope to be notified when the expression I am interested in has changed. But how do I stop watching once I lose interest?
When calling $watch a function is returned that unregisters the bound expression.
$watch
E.g., to watch a variable foo only change once:
foo
var unregister = $scope.$watch('foo', function () { // Do something interesting here ... unregister(); });
Hope that helps :-)