-
Notifications
You must be signed in to change notification settings - Fork 3k
Bugfix in the legacy codebase #3027
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
Comments
yep! Is the issue fixed in 1.0 already? If not, I'd like a PR for both |
From the looks of it it isn't fixed on master yet. I am unsure that my solution would apply to 1.0 though since it involves triggering a state change event. More specifically |
Interesting... although it doesn't seem like that should be handled by the ui-sref directive. It seems like the Can you explain fully what the issue you're solving is? |
I would absolutely love it if
Now, the issue I am trying to solve is quite straightforward. I am in some state In a nutshell, if |
…rective In the current world, ui-sref does nothing when the promise returned by $state.go is rejected. This PR gives ui-sref directive the ability to emit $stateChangeCancel when the transition promise rejects. The reason why I have chosen to implement this in the ui-sref directive and not in the definition for $state.go or $state.transitionTo are outlined in the issue below. angular-ui#3027.
…rective In the current world, ui-sref does nothing when the promise returned by $state.go is rejected. This PR gives ui-sref directive the ability to emit $stateChangeCancel when the transition promise rejects. The reason why I have chosen to implement this in the ui-sref directive and not in the definition for $state.go or $state.transitionTo are outlined in the issue below. angular-ui#3027.
In the current world, ui-sref does nothing when the promise returned by $state.go is rejected. This PR gives ui-sref directive the ability to emit $stateChangeCancel when the transition promise rejects. The reason why I have chosen to implement this in the ui-sref directive and not in the definition for $state.go or $state.transitionTo are outlined in the issue below. angular-ui#3027.
In the current world, ui-sref does nothing when the promise returned by $state.go is rejected. This PR gives ui-sref directive the ability to emit $stateChangeCancel when the transition promise rejects. The reason why I have chosen to implement this in the ui-sref directive and not in the definition for $state.go or $state.transitionTo are outlined in the issue below. angular-ui#3027.
@christopherthielen Any thoughts? Thanks! |
@zeusdeux I commented on your PR that I'd like to implement this correctly in |
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
@christopherthielen I went ahead and PR-ed the implementation in Thanks! |
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
…3039) 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 #3027
closed by ca7c366 |
Would y'all be ok with a PR that is based on
legacy
branch?The PR will address an issue with
ui-sref
where it incorrectly discards the promise returned by$state.go
and doesn't handle promise rejection.It will also fix the erroneous behaviour outlined in #2123 if the state transition was triggered by
ui-sref
directive. Also, the change will be isolated tostateDirective.js
so it shouldn't impede current dev efforts in any way.Thanks!
The text was updated successfully, but these errors were encountered: