From the course: Learning Angular

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Creating subcomponents

Creating subcomponents - Angular Tutorial

From the course: Learning Angular

Start my 1-month free trial

Creating subcomponents

- In regular applications, it's better to create more than one component to separate what's happening in an application into different pieces. Now, that makes it easier to update and to work with. So, let's take a look at how that works. Now, although we can do things manually, there's a lot of little connections that you have to make which are very precise. So, the CLI is going to make that process a lot easier. The CLI is the command line interface that we studied in the first chapter of this course. In order to make the components communicate with each other, we can use properties that are sometimes called "props", which use the square bracket notation to pass along something from the main component to the sub-component. There is some other wiring that we'll need to do, including adding inputs to our sub-components and importing between the files. So, let's take a look at how that's going to work. Here's our application right now and what we're going to do is go over to the…

Contents