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:
Jason Aden
2018-10-16 19:50:48 -07:00
committed by Matias Niemelä
parent 152ca66eba
commit 081f95c812
7 changed files with 213 additions and 77 deletions

View File

@ -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),