fix(router): update the location before activating components

This commit is contained in:
vsavkin
2016-08-25 02:35:46 -07:00
committed by Victor Berchet
parent b9647b7347
commit 2ffecc0e14
2 changed files with 29 additions and 12 deletions

View File

@ -500,8 +500,6 @@ export class Router {
this.currentUrlTree = appliedUrl;
this.currentRouterState = state;
new ActivateRoutes(state, storedState).activate(this.outletMap);
if (!shouldPreventPushState) {
let path = this.urlSerializer.serialize(appliedUrl);
if (this.location.isCurrentPathEqualTo(path) || shouldReplaceUrl) {
@ -510,6 +508,9 @@ export class Router {
this.location.go(path);
}
}
new ActivateRoutes(state, storedState).activate(this.outletMap);
navigationIsSuccessful = true;
})
.then(
@ -536,6 +537,7 @@ export class Router {
}
this.currentRouterState = storedState;
this.currentUrlTree = storedUrl;
this.location.replaceState(this.serializeUrl(storedUrl));
});
});
}