Here is a piece of code destined to check user rights before each UI-router state change. Everything works fine, except the fact that when rights are OK, the transition to the n
try putting the event.preventDefault();
bellow the $state.go
.
This is where I saw the idea for this suggestion: angularjs app.run doesn't get called with state
So basically:
AuthManager.openConnectionPane().then( function( data ) {
if( AuthManager.isUserConnected() ) {
console.log("This message is correctly printed!");
$state.go( toState.name );
}
});
event.preventDefault();