File tree 2 files changed +3
-15
lines changed
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
358
358
// Component loaded. Find its root native view.
359
359
const componentView = componentRef . location . nativeElement ;
360
360
// Remove it from original native parent.
361
- this . viewUtil . removeChild ( componentView . parent , componentView , false ) ;
361
+ this . viewUtil . removeChild ( componentView . parent , componentView ) ;
362
362
// Add it to the new page
363
363
this . viewUtil . insertChild ( page , componentView ) ;
364
364
Original file line number Diff line number Diff line change @@ -157,10 +157,9 @@ export class ViewUtil {
157
157
return next ;
158
158
}
159
159
160
- public removeChild ( parent : View , child : View , removeGrandchildren = true ) {
160
+ public removeChild ( parent : View , child : View ) {
161
161
if ( isLogEnabled ( ) ) {
162
- traceLog ( `ViewUtil.removeChild parent: ${ parent } child: ${ child } `
163
- + `remove grandchildren: ${ removeGrandchildren } ` ) ;
162
+ traceLog ( `ViewUtil.removeChild parent: ${ parent } child: ${ child } ` ) ;
164
163
}
165
164
166
165
if ( ! parent ) {
@@ -170,17 +169,6 @@ export class ViewUtil {
170
169
const extendedParent = this . ensureNgViewExtensions ( parent ) ;
171
170
const extendedChild = this . ensureNgViewExtensions ( child ) ;
172
171
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
-
184
172
this . removeFromQueue ( extendedParent , extendedChild ) ;
185
173
if ( ! isDetachedElement ( extendedChild ) ) {
186
174
this . removeFromVisualTree ( extendedParent , extendedChild ) ;
You can’t perform that action at this time.
0 commit comments