eslint-plugin-angular
eslint-plugin-angular copied to clipboard
Improve behaviour of the "on" lint
- 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
Fixes https://github.com/Gillespie59/eslint-plugin-angular/issues/231
Can you do your PR on the development branch? Thanks by the way ;)
Any reason not to do this?
$rootScope.$on('$destroy', $rootScope.$on(EVENTS.changeRegion, function() {
vm.nowRegion = OpsService.getRegion();
}));
@gitnik any plan to work on this one?
Thanks
Would love to see this