196
rated 0 times
[
198]
[
2]
/ answers: 1 / hits: 17668
/ 11 Years ago, wed, october 16, 2013, 12:00:00
I know you can unbind a $watch like this:
var listener = $scope.$watch(tag, function () {});
// ...
listener(); // would clear the watch
but can you unbind the watch within the watch function declaration. So after the watch gets executed once, it unbinds itself? Something like:
$scope.$watch(tag, function () {
unbindme()
});
More From » angularjs