fix(router): update URL after redirects when urlHandlingStrategy='eager' (#27356)

fixes #27076

PR Close #27356
This commit is contained in:
Jason Aden
2018-11-29 13:35:26 -08:00
parent 57dae161c3
commit 11a8bd8aca
2 changed files with 39 additions and 3 deletions

View File

@ -389,9 +389,6 @@ export class Router {
if (processCurrentUrl) {
return of (t).pipe(
// Update URL if in `eager` update mode
tap(t => this.urlUpdateStrategy === 'eager' && !t.extras.skipLocationChange &&
this.setBrowserUrl(t.rawUrl, !!t.extras.replaceUrl, t.id)),
// Fire NavigationStart event
switchMap(t => {
const transition = this.transitions.getValue();
@ -416,6 +413,10 @@ export class Router {
this.rootComponentType, this.config, (url) => this.serializeUrl(url),
this.paramsInheritanceStrategy, this.relativeLinkResolution),
// Update URL if in `eager` update mode
tap(t => this.urlUpdateStrategy === 'eager' && !t.extras.skipLocationChange &&
this.setBrowserUrl(t.urlAfterRedirects, !!t.extras.replaceUrl, t.id)),
// Fire RoutesRecognized
tap(t => {
const routesRecognized = new RoutesRecognized(