fix(router): update the router not to reset router state when updating root component (#11799)
This commit is contained in:

committed by
Alex Eagle

parent
212f8dbde7
commit
31dce72b7b
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user