Angular – HostListener

@HostListener is Angular’s decorator method that’s used for listening to DOM events on the host element of both component and attribute directives. @HostListener sets the listeners once the directive is initialized and removes them automatically once the directive gets destroyed.

Write a Reply or Comment

Your email address will not be published.