fix(upgrade): ensure downgraded components are destroyed in the Angular zone
This commit is contained in:

committed by
Alex Rickabaugh

parent
745b59f49c
commit
4e6aa9c2db
@ -203,11 +203,13 @@ export class DowngradeComponentAdapter {
|
||||
}
|
||||
|
||||
registerCleanup(needsNgZone: boolean) {
|
||||
const destroyComponentRef = this.wrapCallback(() => this.componentRef.destroy());
|
||||
|
||||
this.element.on !('$destroy', () => {
|
||||
this.componentScope.$destroy();
|
||||
this.componentRef.injector.get(TestabilityRegistry)
|
||||
.unregisterApplication(this.componentRef.location.nativeElement);
|
||||
this.componentRef.destroy();
|
||||
destroyComponentRef();
|
||||
if (needsNgZone) {
|
||||
this.appRef.detachView(this.componentRef.hostView);
|
||||
}
|
||||
|
Reference in New Issue
Block a user