Sunday, 15 March 2015

javascript - AngularJS : Clear $watch -



javascript - AngularJS : Clear $watch -

i have watch function in angularjs application.

$scope.$watch('quartzcrystal', function () { ... }

however, after status (in example, changing page @ single-page application) want stop watch (as clearing timeout).

how can that?

$watch returns deregistration function. calling deregister $watcher.

var listener = $scope.$watch("quartz", function () {}); // ... listener(); // clear watch

javascript angularjs watch

No comments:

Post a Comment