Host binding in directives

In the Angular realm, the component/element that a directive gets attached to is termed the host element: a container that hosts our directive/component. For the BusyIndicatorDirective, the input element is the host.

While we can use the Renderer to manipulate the host (and we did too), the Angular data binding infrastructure can reduce the code further. It provides a declarative way to manage directive-host interaction. Using the host binding concepts, we can manipulate an element's properties and attributes and subscribe to its events.

Let's understand each of the host binding capabilities, and at the end, we will fix our BusyIndicatorDirective implementation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.3.208