HostListener is still listening after ngOnDestroy started #38100
Labels
area: core
Issues related to the framework runtime
core: lifecycle hooks
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
type: confusing
Milestone
馃悶 bug report
Affected Package
@angular/core
Is this a regression?
No, I caught this bug in a version 7 first
Description
There can be some situations in that we need to dispatch an event on component destroy.
If we have HostListener listening type of event we dispatch, it catches this.
So, in other words, HostListener continues listening even after ngOnDestroy has already started.
Is it a bug or by design?
馃敩 Minimal Reproduction
https://stackblitz.com/edit/angular-hostlintener-bug?file=src%2Fapp%2Fhello.component.ts
馃敟 Exception or Error
馃實 Your Environment
Angular Version:
The text was updated successfully, but these errors were encountered: