-
Notifications
You must be signed in to change notification settings - Fork 49
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
Does it work with ui-router #15
Comments
@amrinder23 I m not as familiar with UI Router. I can figure it out and post here eventually (I'm getting ready to leave for work). In the meantime, I'd suggest searching "angular ui router protect routes" or something similar to see the mechanism for bailing out of a route based on some sort of logic. Then I'd implement this If you find a good solution, please share 😄 |
@amrinder23 If you use !, the only thing different is the statement app.run () app.run(['$rootScope', '$state', function ($rootScope, $state) {
// If the route change failed due to our "Unauthorized" error, redirect them
$rootScope.$on('$stateChangeError', function (event, toState, toParams, fromState, fromParams, rejection) {
if (rejection === 'Unauthorized') {
$state.go('home');
}
});
}]); |
@yhon92 thanks for the comment 👍 |
Thanks @yhon92 .. I will try this. 👍 |
Thanks @mikemclin for an awesome service. |
@mikemclin .. Just another question. Can't we remain on the same state ? |
|
@yhon92 I am using v0.2.15 of ui-router |
Hi Mike,
Can i use it in an application using ui-router for routing.
Regards
Amrinder
The text was updated successfully, but these errors were encountered: