Skip to content

uiCanExit and redirect to feature #3308

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

Closed
viros opened this issue Jan 31, 2017 · 1 comment
Closed

uiCanExit and redirect to feature #3308

viros opened this issue Jan 31, 2017 · 1 comment
Milestone

Comments

@viros
Copy link

viros commented Jan 31, 2017

I have a state {name : 'A', redirectTo: 'A.A'}.
I have another state {name: 'B'}. State 'B' implement uiCanExit method and returns a promise returned by modal confirmation popup.
If i navigate to state 'A' from 'B' then uiCanExit called 2 times. As i understand first time because transition to 'A' then it rejected because redirectTo then it navigates to 'A.A'

Not sure, but problem might be in redirectTo implementation, probaly redirectTo handled too late. It works fine if i use hook and moreover i can use abstract state with redirectTo

 $transitions.onBefore({
                to: function (targetState) {
                    return !_.isEmpty(targetState.redirectTo)
                }
            }, function (trans) {
                return trans.router.stateService.target(trans.to().redirectTo);
            });
@christopherthielen christopherthielen modified the milestones: 1.0.0-final, 1.0.0-rc.2 Mar 19, 2017
@christopherthielen
Copy link
Contributor

Agreed, this should work intuitively. Will add a fix for rc.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants