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
BC-BREAK: Transition Hooks are no longer injected (onBefore/onStart/onExit/onRetain/onEnter/onFinish/onSuccess/onError)
Previously, a hook like `['$state', ($state) => $state.target('foo')]` would get `$state` injected.
Now, all hooks receive three parameters:
- transition: the current Transition
- injector: the $injector (ng1) or Injector (ng2) or fake injector (non-angular)
- state: for onEnter/onRetain/onExit hooks only, the State which the hook is being run for. This value will be null for onBefore/onStart/onFinish/onSuccess/onError hooks.
Refactor your hooks
from: `['$state', ($state) => $state.target('foo')]`
to: `(trans, injector) => injector.get('$state').target('foo')`
feat(onEnter): Hooks receive 3 args: (Transition, Injector, State) and are not injectable
feat(onEnter): state declaration onEnter hooks are still injected
0 commit comments