If you have used AngularJS, you probably have at least once used the Scope.$on
or Scope.$watch
methods, and probably had to dispose of listeners / watchers. Here’s a little trick you may like to do just that in a few lines.
If you have used AngularJS, you probably have at least once used the Scope.$on
or Scope.$watch
methods, and probably had to dispose of listeners / watchers. Here’s a little trick you may like to do just that in a few lines.