UI-Router 1.x
Closed this issue · 4 comments
After upgrading to angular-ui-router 1.x it seems that angular-permission is no longer working properly. I'm also using polyfill that re-enables the $stateChangeStart
angular events but I still have problems when I'm using $transitions
and redirectTo
is not working anymore. Is there any chance of migrating to angular-ui-router 1.x?
I also have this same problem!
It works now for me :), in my case I was working with version 5.1 of angular-permission, and I upgraded it to the latest version, there was no need to include the polyfill to re-enable the $stateChangeStart event.
If it is working for @valentina91p I guess it will work for me too then. I will check it today, but you can close the issue then. Thank you.
Edit:
This was creating a problem for me.
$transitions.onStart({to: function(state) {
return state.name !== 'login';
}}, function (trans) {
if(($window.sessionStorage.userToken == 'undefined' || !$window.sessionStorage.userToken)) {
$state.go('login');
return false;
} else {
return true;
}
});
This was preventing my state permissions from executing. When I change it to the $transitions.onEnter
the problem was gone so my guess is that it had something to do with transition lifecycle.