Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up$state.go not working from inside $stateChangeStart handler #969
Comments
|
Are you calling preventDefault on the first event ? |
|
Plunkr? |
|
event.preventDefault() got it! thanks marcghorayeb! |
|
hum... why is |
|
@xpepermint Because he's using the event handler to prevent the initial transition. |
|
thx @nateabele |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am working on a security module and trying to have the $stateChangeStart event handler redirect $state based on certain conditions.
For example:
I am calling $state.go('login', null, {reload: true, location: 'replace'}) from inside a $stateChangeStart handler with toState 'test'. It seems to start loading the 'login' state, but never finishes loading it, and also finishes loading the 'test' state.
I get a $stateChangeSuccess for 'test', but only a $stateChangeStart for 'login'.