feat(router): allow guards to return UrlTree as well as boolean (#26521)
* Removed `andObservable` helper function in favor of inline implementation * Flow `boolean | UrlTree` through guards check * Add tests to verify behavior of `checkGuards` function flowing `UrlTree` properly PR Close #26521
This commit is contained in:

committed by
Matias Niemelä

parent
152ca66eba
commit
081f95c812
@ -19,7 +19,7 @@ export class Logger {
|
||||
empty() { this.logs.length = 0; }
|
||||
}
|
||||
|
||||
export function provideTokenLogger(token: string, returnValue = true) {
|
||||
export function provideTokenLogger(token: string, returnValue = true as boolean | UrlTree) {
|
||||
return {
|
||||
provide: token,
|
||||
useFactory: (logger: Logger) => () => (logger.add(token), returnValue),
|
||||
|
Reference in New Issue
Block a user