-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix($state.transitionTo): trigger $stateChangeCancel appropriately #3039
fix($state.transitionTo): trigger $stateChangeCancel appropriately #3039
Conversation
Good work! Can you update your PR so it doesn't change all the whitespace? |
Ah damn. Auto save hooks. On it. |
@christopherthielen Done! |
Current behaviour: We are in state A. We start a transition to state B. `$stateChangeStart` is triggered. Before `$stateChangeSuccess` is triggered for state B, we start a transition back to state A. No state events are triggered and we are left hanging without any notification. Updated behaviour: When the state change to B is superseded by the state change back to A, `$stateChangeCancel` is broadcasted on `$rootScope` for the transition from B -> A. This behaviour makes sure that for every `$stateChangeStart` there is a corresponding `$stateChange<Success|Error|Cancel>` thus completing the lifecycle. Fixes issue angular-ui#3027
6dc93a2
to
71b5b61
Compare
Hey @christopherthielen, do you think this PR is merge ready? I would love to have Thanks! |
I think it's probably good to merge, but I'd like to play with it for a little bit before releasing 0.3.2 |
@christopherthielen Sounds good. Do you have a time estimate in mind? It would be very useful for me to be able to communicate that to my team. |
I think #2696 should be fixed first, then I'm ready to release 0.3.2 |
@christopherthielen Could we get |
@zeusdeux released 0.3.2 |
This PR supersedes #3029
Current behaviour:
We are in state A. We start a transition to state B.
$stateChangeStart
is triggered. Before
$stateChangeSuccess
is triggered for state B, westart a transition back to state A. No state events are triggered and we
are left hanging without any notification.
Updated behaviour:
When the state change to B is superseded by the state change back to A,
$stateChangeCancel
is broadcasted on$rootScope
for the transition fromB -> A. This behaviour makes sure that for every
$stateChangeStart
thereis a corresponding
$stateChange<Success|Error|Cancel>
thus completing thelifecycle.
Fixes issue #3027
PS: I have modified the existing test suite to assert on new behaviour