ANGULAR COMPONENTS

 

How to create now components in Angular project:


There are two ways to create angular components 

a. Manually create.

step 1: create compnent folder e.g.: register 

step 2: create register.compnent.html

step 3: create register.compnent.css

step 4: create register.compnent.ts

step 5: import register module in app.module.ts folder 

import { RegisterCompnent } from'./register/register.component';

@NgModule({

declaration:[

AppComponent,

RegisterComponent

],

b. By using command. 

e.g.: To create register component. 

  • ng generate component register.
  • ng g component register
  • ng generate c register
  • ng g c register