Angular Component controls a patch of the screen called a view. For example, individual components define and control each view. When you install the project via Angular CLI, then by default, we got one Component that is an app component.

Angular Components are the smallest pieces in the Angular Application. We can define the Components in the Typescript file.

Components are just regular TypeScript classes but with the Component Decorator. It differentiates standard class from the component class.

Angular Components Example

If you analyze the app.component.ts file, you will see something like this.

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})

Here Component is defined by a decorator @Component. It contains Metadata**. **

#angular #component decorator #angular cli #typescript

Angular 9 Components Example For Beginners
1.10 GEEK