|
6 | 6 | * found in the LICENSE file at https://angular.io/license |
7 | 7 | */ |
8 | 8 |
|
9 | | -import {createEnvironmentInjector, EnvironmentInjector, Type, ɵRuntimeError as RuntimeError} from '@angular/core'; |
| 9 | +import {EnvironmentInjector, Type, ɵRuntimeError as RuntimeError} from '@angular/core'; |
10 | 10 | import {EmptyError, from, Observable, Observer, of} from 'rxjs'; |
11 | | -import {catchError, concatMap, defaultIfEmpty, first, last as rxjsLast, map, scan, startWith, switchMap, takeLast, takeWhile} from 'rxjs/operators'; |
| 11 | +import {catchError, concatMap, defaultIfEmpty, first, last as rxjsLast, map, scan, switchMap, takeWhile} from 'rxjs/operators'; |
12 | 12 |
|
13 | 13 | import {RuntimeErrorCode} from './errors'; |
14 | 14 | import {Data, ResolveData, Route, Routes} from './models'; |
15 | 15 | import {ActivatedRouteSnapshot, inheritedParamsDataResolve, ParamsInheritanceStrategy, RouterStateSnapshot} from './router_state'; |
16 | 16 | import {PRIMARY_OUTLET} from './shared'; |
17 | 17 | import {UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree'; |
18 | 18 | import {last} from './utils/collection'; |
19 | | -import {getOrCreateRouteInjectorIfNeeded, getOutlet, sortByMatchingOutlets} from './utils/config'; |
| 19 | +import {getOutlet, sortByMatchingOutlets} from './utils/config'; |
20 | 20 | import {isImmediateMatch, matchWithChecks, noLeftoversInUrl, split} from './utils/config_matching'; |
21 | 21 | import {TreeNode} from './utils/tree'; |
| 22 | +import {isEmptyError} from './utils/type_guards'; |
22 | 23 |
|
23 | 24 | const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode; |
24 | 25 |
|
@@ -156,7 +157,7 @@ export class Recognizer { |
156 | 157 | r._injector ?? injector, r, segmentGroup, segments, outlet); |
157 | 158 | }), |
158 | 159 | first((x): x is TreeNode<ActivatedRouteSnapshot>[] => !!x), catchError(e => { |
159 | | - if (e instanceof EmptyError) { |
| 160 | + if (isEmptyError(e)) { |
160 | 161 | if (noLeftoversInUrl(segmentGroup, segments, outlet)) { |
161 | 162 | return of([]); |
162 | 163 | } |
|
0 commit comments