File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed
Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ export class PageRouterOutlet implements OnDestroy { // tslint:disable-line:dire
358358 // Component loaded. Find its root native view.
359359 const componentView = componentRef . location . nativeElement ;
360360 // Remove it from original native parent.
361- this . viewUtil . removeChild ( componentView . parent , componentView , false ) ;
361+ this . viewUtil . removeChild ( componentView . parent , componentView ) ;
362362 // Add it to the new page
363363 this . viewUtil . insertChild ( page , componentView ) ;
364364
Original file line number Diff line number Diff line change @@ -157,10 +157,9 @@ export class ViewUtil {
157157 return next ;
158158 }
159159
160- public removeChild ( parent : View , child : View , removeGrandchildren = true ) {
160+ public removeChild ( parent : View , child : View ) {
161161 if ( isLogEnabled ( ) ) {
162- traceLog ( `ViewUtil.removeChild parent: ${ parent } child: ${ child } `
163- + `remove grandchildren: ${ removeGrandchildren } ` ) ;
162+ traceLog ( `ViewUtil.removeChild parent: ${ parent } child: ${ child } ` ) ;
164163 }
165164
166165 if ( ! parent ) {
@@ -170,17 +169,6 @@ export class ViewUtil {
170169 const extendedParent = this . ensureNgViewExtensions ( parent ) ;
171170 const extendedChild = this . ensureNgViewExtensions ( child ) ;
172171
173- // Remove the child's children and their children
174- // Unless called from PageRouterOutlet when the child is moved from once parent to another.
175- while ( extendedChild && extendedChild . firstChild && removeGrandchildren ) {
176- const grandchild = extendedChild . firstChild ;
177- if ( isLogEnabled ( ) ) {
178- traceLog ( `ViewUtil.removeChild parent: ${ parent } child: ${ extendedChild } grandchild: ${ grandchild } ` ) ;
179- }
180-
181- this . removeChild ( extendedChild , grandchild ) ;
182- }
183-
184172 this . removeFromQueue ( extendedParent , extendedChild ) ;
185173 if ( ! isDetachedElement ( extendedChild ) ) {
186174 this . removeFromVisualTree ( extendedParent , extendedChild ) ;
You can’t perform that action at this time.
0 commit comments