-
Notifications
You must be signed in to change notification settings - Fork 398
Updated for the new transitions hooks #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
event.preventDefault(); | ||
return $state.go('app.login'); | ||
} | ||
let redirectToLogin = ['$auth', '$transition$', ($auth) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is $transitions
needed here?
And minification safe di works through ngInject.. so can you please move $auth to the top so that we avoid the duplication (between '$auth'
and $auth
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work if i move them to the top, they're special injectables for the onBefore method, note that the $transitions
it's not the same as $transition$
used here, the $transition$
returns the current transition and like i said it's a special injectable for the onBefore method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay my bad
Thanks!
but now since we don't need $transition$
can't we remove it?
And could you also please try 1 more thing?
If it's possible to remove `'$auth', '$transition$' with this line:
let redirectToLogin = ($auth) => {
'ngInject';
I think ngInject
should manage the dependencies properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jadjoubran done, so far so good.
Thanks! |
Great thanks 🚀 |
When updated ui-router in #283 didn't realize that the stateChange* events have been deprecated and disabled by default in ui-router 1.0* (my bad) and the new way to do this is using the new Transition hooks as explained here: https://github.com/angular-ui/ui-router/releases/tag/1.0.0alpha0 so this fixes #295