fix(router): add relativeLinkResolution
to recognize
operator (#26990)
Close #26983 PR Close #26990
This commit is contained in:

committed by
Andrew Kushnir

parent
f0c4f31771
commit
a752971bca
@ -17,13 +17,13 @@ import {UrlTree} from '../url_tree';
|
||||
|
||||
export function recognize(
|
||||
rootComponentType: Type<any>| null, config: Route[], serializer: (url: UrlTree) => string,
|
||||
paramsInheritanceStrategy: 'emptyOnly' |
|
||||
'always'): MonoTypeOperatorFunction<NavigationTransition> {
|
||||
paramsInheritanceStrategy: 'emptyOnly' | 'always', relativeLinkResolution: 'legacy' |
|
||||
'corrected'): MonoTypeOperatorFunction<NavigationTransition> {
|
||||
return function(source: Observable<NavigationTransition>) {
|
||||
return source.pipe(mergeMap(
|
||||
t => recognizeFn(
|
||||
rootComponentType, config, t.urlAfterRedirects, serializer(t.urlAfterRedirects),
|
||||
paramsInheritanceStrategy)
|
||||
paramsInheritanceStrategy, relativeLinkResolution)
|
||||
.pipe(map(targetSnapshot => ({...t, targetSnapshot})))));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ export class Router {
|
||||
// Recognize
|
||||
recognize(
|
||||
this.rootComponentType, this.config, (url) => this.serializeUrl(url),
|
||||
this.paramsInheritanceStrategy),
|
||||
this.paramsInheritanceStrategy, this.relativeLinkResolution),
|
||||
|
||||
// Fire RoutesRecognized
|
||||
tap(t => {
|
||||
|
Reference in New Issue
Block a user