You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
In new 1.5.0 release is possible to use $onInit hook which is similar to ngOnInit from Angular 2 lifecycle hooks. It will help with keeping controller's constructors clean, with initialization logic moved to the $onInit method.
I think worth consideration is backport also ngOnDestroy, as $onDestroy for example.
Use Case:
In recent project in my company on of the business rules is to send request to device every second (which we have done with timeouts). We try to stay away as possible from injecting $scope to controllers, but timeouts needs to be cleared when user opens new view or hits back button on mobile device etc... So we solved this with $scope.$on: