By using the @HostListener and @HostBinding decorators we can both listen to output events from our host element and also bind to input properties on our host element as well. In the next lecture we will cover how to provide inputs and configuration to ou
With Angular, we try to avoid touching the DOM directly for certain rendering and performance reasons. There is a specific API within Angular we can use to listen to the global window and document events like the keyup and keydown events. Host Listeners.
In Angular, you do this using @HostListener(). To understand @HostListener() in a better way, consider another simple scenario: on the click of the host element, you want to show an alert window.
Post a Comment:
Showing 0 Comments: