mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(common): remove load event listener once it is fired (#52512)
This commit removes the `load` event listener once it has fired within the `ImagePerformanceWarning`. The `load` event listener prevents the zone stuff from being garbage collected in development mode when debugging microfrontend applications that may be destroyed multiple times. PR Close #52512
This commit is contained in:
parent
1ce31d819b
commit
2205c8993f
1 changed files with 1 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ export class ImagePerformanceWarning implements OnDestroy {
|
|||
// Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in
|
||||
// the scope of this functionality.
|
||||
this.ngZone.runOutsideAngular(() => {
|
||||
this.window?.addEventListener('load', waitToScan);
|
||||
this.window?.addEventListener('load', waitToScan, {once: true});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue