fix(router): update the router not to reset router state when updating root component (#11799)

This commit is contained in:
Victor Savkin
2016-09-21 11:37:43 -07:00
committed by Alex Eagle
parent 212f8dbde7
commit 31dce72b7b
2 changed files with 22 additions and 2 deletions

View File

@ -323,7 +323,9 @@ export class Router {
*/
resetRootComponentType(rootComponentType: Type<any>): void {
this.rootComponentType = rootComponentType;
this.currentRouterState = createEmptyState(this.currentUrlTree, this.rootComponentType);
// TODO: vsavkin router 4.0 should make the root component set to null
// this will simplify the lifecycle of the router.
this.currentRouterState.root.component = this.rootComponentType;
}
/**