In this tutorial, we will learn how to create angular sections or Use to produce a component using CLI to create angular sections for your project.

we will learn a very simple code generating code how to use the Angular CLI ng component command, or its shortcut command, Read this tutorial.

ng generate component or ng g c with Angular CLI

Let's assume we want to create an Angular component named About.

Open a new command-line interface ( command prompt ), navigate into the root of your Angular project and run the following command:

ng generate component about

Or you can also run the following Short command:

ng g c about

Angular CLI will generate 4 files for the component in the src/app folder of your project see below:

We can also customize where the component's files are placed. Angular CLI adds the component to the declarations array of the module.


I hope it can help you...