fix(core): don’t detach nested view containers when destroying a view
When a view is destroyed, we destroy all
views in view containers and should not detach them. However, previously, we also detached them which lead to problems during the iteration loop.
Closes #8458
Closes #8471
Introduced by 0c600cf6e3
This commit is contained in:
@ -192,13 +192,7 @@ export abstract class AppView<T> {
|
||||
ObservableWrapper.dispose(this.subscriptions[i]);
|
||||
}
|
||||
this.destroyInternal();
|
||||
if (this._hasExternalHostElement) {
|
||||
this.renderer.detachView(this.flatRootNodes);
|
||||
} else if (isPresent(this.viewContainerElement)) {
|
||||
this.viewContainerElement.detachView(this.viewContainerElement.nestedViews.indexOf(this));
|
||||
} else {
|
||||
this.dirtyParentQueriesInternal();
|
||||
}
|
||||
this.dirtyParentQueriesInternal();
|
||||
this.renderer.destroyView(hostElement, this.allNodes);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user