Skip to content

uiCanExit and redirect to feature #3308

Closed
@viros

Description

@viros

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);
            });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions