Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // call to $watch will return a de-register function
- var listener = $scope.$watch(someVariableToWatch, function(....));
- $scope.$on('$destroy', function() {
- listener(); // call the de-register function on scope destroy
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement