feat(router): guard returning UrlTree cancels current navigation and redirects (#26521)
Fixes #24618 FW-153 #resolve PR Close #26521
This commit is contained in:

committed by
Matias Niemelä

parent
081f95c812
commit
4e9f2e5895
@ -672,10 +672,11 @@ function checkGuards(
|
||||
guards: getAllRouteGuards(future, curr, new ChildrenOutletContexts())
|
||||
} as Partial<NavigationTransition>)
|
||||
.pipe(checkGuardsOperator(injector))
|
||||
.subscribe(
|
||||
t => {
|
||||
if (t.guardsResult === null) throw new Error('Guard result expected');
|
||||
return check(t.guardsResult);
|
||||
},
|
||||
(e) => { throw e; });
|
||||
.subscribe({
|
||||
next(t) {
|
||||
if (t.guardsResult === null) throw new Error('Guard result expected');
|
||||
return check(t.guardsResult);
|
||||
},
|
||||
error(e) { throw e; }
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user