From the course: Creating Angular Libraries
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Directive composition - Angular Tutorial
From the course: Creating Angular Libraries
Directive composition
- [Derek] Directive composition lets you combine simple directives into more complex behaviors. You do this using the host directives array on the directive decorator. Array values can be directive classes or configuration objects. Directives you pass into this array are called "host directives." You apply one or more of these host directives to a host class. host directives have the same lifecycle as any other component or directive. They always execute their lifecycles before the host does. But if you have more than one host directive on a host, the exact order of execution is not guaranteed. By default, host directives hide their inputs and outputs from the host. You must expose inputs and outputs manually as part of the configuration object for that directive. Let's see what all this looks like in the code. I opened our project here in a GitHub code space. I talk about why we use code spaces earlier in this course. So for now, just think of them as an easy way to share and write…
Contents
-
-
-
-
(Locked)
Stateless components5m 12s
-
(Locked)
Pure pipes2m 31s
-
(Locked)
Tree-shakeable providers2m 55s
-
(Locked)
Internationalization1m 52s
-
(Locked)
Directive composition2m 31s
-
(Locked)
Gain more control with Angular refs3m 36s
-
(Locked)
Testing and debugging Angular libraries2m 12s
-
(Locked)
Coding challenge18s
-
(Locked)
Solution2m 5s
-
(Locked)
-
-
-