Skip to content

Commit 6a7b818

Browse files
atscottthePunderWoman
authored andcommitted
fix(router): Ensure target RouterStateSnapshot is defined in NavigationError (#46842)
The Router transition observable pipe keeps an outer reference to a `t` variable for use in the `catchError` operator. However, this variable is not updated with intermediate state. This commit fixes that so the `catchError` can access properties that get updated in intermediate states. Specifically, `RouterStateSnapshot` in the `NavigationError` for now but could be more in the future. PR Close #46842
1 parent 9ecaa05 commit 6a7b818

3 files changed

Lines changed: 386 additions & 351 deletions

File tree

packages/router/src/operators/recognize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {EnvironmentInjector, Injector, Type} from '@angular/core';
9+
import {EnvironmentInjector, Type} from '@angular/core';
1010
import {MonoTypeOperatorFunction} from 'rxjs';
1111
import {map, mergeMap} from 'rxjs/operators';
1212

1313
import {Route} from '../models';
1414
import {recognize as recognizeFn} from '../recognize';
1515
import {NavigationTransition} from '../router';
16-
import {UrlSerializer, UrlTree} from '../url_tree';
16+
import {UrlSerializer} from '../url_tree';
1717

1818
export function recognize(
1919
injector: EnvironmentInjector, rootComponentType: Type<any>|null, config: Route[],

0 commit comments

Comments
 (0)