How to Create Component in Angular 10

How to Create Component in Angular 10

Today, we will explain to you how to create a component in angular 10. in this article will know you how to create components using the ng generate component command.

You can easily create the new components using the Angular CLI command. so you can follow steps for creating components using Angular CLI.

Create new angular app

We will create a new angular app using the following command.

ng generate component

first, open the command prompt or terminal and create the component using the below command.

You can also execute the following command.

The above command will generate 4 files in the “src/app” directory.

If want to add code or write edit some code in these 4 files then you can do that. when are you create the component using the command line then that component automatically added in the app.module.ts file.

Read Also
Angular 10 CRUD Application Example Tutorial
Angular 10 Bootstrap 4 Datepicker Example
Install Bootstrap 4 In Angular 10 With Example

Please follow and like us: