Embedding child components

Now, let's start building a tiny icon component that will be nested inside the TasksComponent component. This new component will display a smaller version of our big icon, which we will use to display on the template the amount of tasks lined up to be done, as we described earlier in this chapter. Let's pave the way towards component trees, which we will analyze in detail in Chapter 6, Building an Application with Angular Components. For now, just include the following component class before the TasksComponent   class you built earlier.

Our component will expose a public property named task in which we can inject a Task object. The component will use this Task object binding to replicate the image rendered in the ...

Get Learning Angular - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.