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