Closed SebastianPodgajny closed 1 week ago
core
No
Component is removed form DOM but ngOnDestroy is not called
ngOnDestroy
Steps to reproduce:
DialogDataExampleDialog ngOnDestroy
dialogRef.overlayRef.dispose();
@if (true)
DialogDataExampleDialog ngOnDestroy TestCmp ngOnDestroy DialogOpenerCmp ngOnDestroy
https://stackblitz.com/edit/yne7sc?file=src%2Fexample%2Fdialog-data-example.ts
There is no exception, but there should be if calling `dispose` in ngOnDestroy is not supported
ng version
Angular CLI: 19.0.0-next.2 Node: 18.20.3 Package Manager: npm 10.2.3 OS: linux x64 Angular: 19.0.0-next.2 ... animations, cdk, cli, common, compiler, compiler-cli, core ... forms, localize, material, material-moment-adapter ... platform-browser, platform-browser-dynamic, router Package Version --------------------------------------------------------- @angular-devkit/architect 0.1900.0-next.2 @angular-devkit/build-angular 19.0.0-next.2 @angular-devkit/core 19.0.0-next.2 @angular-devkit/schematics 19.0.0-next.2 @schematics/angular 19.0.0-next.2 rxjs 7.4.0 typescript 5.5.4 zone.js 0.15.0
No response
This is likely the same issue as https://github.com/angular/angular/issues/58075.
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Component is removed form DOM but
ngOnDestroy
is not calledSteps to reproduce:
dialogRef.overlayRef.dispose();
or@if (true)
and repeat 1-3Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/yne7sc?file=src%2Fexample%2Fdialog-data-example.ts
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response