A component in Angular controls a part of the screen called a view. It consists of:
Creating a component:
import { Component } from '@angular/core';
@Component({
selector: 'app-example',
template: '<h1>{{title}}</h1>',
styleUrls: ['./example.component.css']
})
export class ExampleComponent {
title = 'Hello World';
}