Closed
Description
If I return just TargetState it works. But if the I return the TargetState from within a promise it does not. My hook looks like this
function hook(transition) {
var target = transition.router.stateService.target,
targetState = transition.targetState(),
targetStateInternal = targetState.state(),
targetStateData = targetStateInternal && targetStateInternal.data,
allowAnonymous = targetStateData && targetStateData.allowAnonymous;
// Returning right here outside of promise will work. Ie:
// return target(loginStateName, { redirectTo: targetState.name(), redirectParams: targetState.params() });
return !allowAnonymous ? signInManager.isSignedIn().then(noop, error) : null;
function error() {
return target(loginStateName, {
redirectTo: targetState.name(),
redirectParams: targetState.params()
});
}
}
Metadata
Metadata
Assignees
Labels
No labels