Posted On: Mar 13, 2020
The @HostListener is a decorator method in Angular 6 that is used for listening to DOM events. It listens to the DOM events on the host element of both the component and attribute components. It sets the listener once when the directive is initialized and removes the listener if the directive is destroyed.
Never Miss an Articles from us.