eslint-plugin-angular icon indicating copy to clipboard operation
eslint-plugin-angular copied to clipboard

Improve behaviour of the "on" lint

Open gitnik opened this issue 9 years ago • 6 comments

  • The lint will from now on only handle "$on" calls, as "$watches" are automatically removed upon destroying the scope. I therefore also changed the name of the lint to match what is does.
  • The lint will no longer complain about not unsubscribing from the $rootScope. While there can be cases where this is valid, most of the time it isn't
  • Adapt tests
  • Adapt documentation

gitnik avatar Nov 13 '15 21:11 gitnik

Fixes https://github.com/Gillespie59/eslint-plugin-angular/issues/231

gitnik avatar Nov 13 '15 21:11 gitnik

Can you do your PR on the development branch? Thanks by the way ;)

EmmanuelDemey avatar Nov 14 '15 10:11 EmmanuelDemey

Any reason not to do this?

$rootScope.$on('$destroy', $rootScope.$on(EVENTS.changeRegion, function() {
  vm.nowRegion = OpsService.getRegion();
}));

charneykaye avatar Nov 23 '15 19:11 charneykaye

@gitnik any plan to work on this one?

Thanks

mustela avatar Jan 20 '16 16:01 mustela

Would love to see this

briananderson1222 avatar Feb 17 '16 18:02 briananderson1222

ivan-zakharchuk avatar Feb 26 '16 15:02 ivan-zakharchuk