The hostDirectives Property
Attach directives to a component host.
Directive Composition API
The Directive Composition API lets a component or directive apply other directives to its own host element declaratively, via the hostDirectives property. This enables reuse without inheritance.
The Problem It Solves
Previously, to reuse directive behavior you either repeated the directive in every template or used inheritance. hostDirectives composes behaviors directly onto a host.
All lessons in this course
- The hostDirectives Property
- Exposing Inputs and Outputs
- Building Reusable Behaviors
- Composition vs Inheritance