When calling $watch a function is returned that unregisters the bound expression.
E.g., to watch a variable foo only change once:
var unregister = $scope.$watch('foo', function () {
// Do something interesting here ...
unregister();
});
When calling $watch a function is returned that unregisters the bound expression.
E.g., to watch a variable foo only change once:
var unregister = $scope.$watch('foo', function () {
// Do something interesting here ...
unregister();
});