Angular · Decorator
@HostListener
@HostListener connects a class method to a DOM event on the host element. It can also listen on document, window, or body and pass event values to the method.
Last updated
Syntax
@HostListener(eventName: string, args?: string[]);In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
@HostBindinghost propertyKeyboardEvent.keycode modifier