From the course: Learning the Angular CLI

Unlock the full course today

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

Generating components and modules

Generating components and modules - Angular Tutorial

From the course: Learning the Angular CLI

Start my 1-month free trial

Generating components and modules

- [Instructor] Let's see how we can generate components. We will do so by using the ng generate components schematic named contact list and we will use the dry run flag which allows us to see how and where these files are placed without actually writing them to disk. It's a great way to first test out and see what files will be generated. There are also some useful shortcuts. For example, instead of the previous command we could have run ng g c which is short for generate component. By default component files are placed in their own folder. If this isn't desired you can change that by using the dash dash flat flag. And we see that instead of creating a folder it created the files directly under the app folder. Let's go ahead and generate the component with this corresponding folder. So we will now omit the dry run flag ng g c contact dash list. We see a new folder that's generated here. We open that up, we have an…

Contents