What is the component in Angular?

Component is an element of the Angular app. They are the main building blocks. Each component is a type of directive. Component is made of class with Component metadata, html template, css selector and optionally css style apply to html template. Component have lifecycle hooks.

Cli command

ng g c app-component-overview

Syntax :-

@Component({

selector: ‘app-component-overview’,

templateUrl: ‘./component-overview.component.html’,

styleUrls: [‘./component-overview.component.css’]

})

export class ComponentOverviewComponent {

}

--

--

--

Software Engineer | Bharat Swabhiman Patanjali Social Activist | Speaker | Motivator | Yoga Trainer

Recommended from Medium

Angular Learning (Part2)

Angular 13: How to Install MDB 5

Automated UI/UX Testing with Puppeteer Mocha and Chai

Practice project to stay sharp: React Typing Game (Part 2)

How to eliminate (or deal with) hidden dependencies

Export Buttons In Datatable

useState — Diving Deep into React Hooks (2021)

React JS Topics For Beginners

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ACHARYA ANIL SURYAVANSHI

ACHARYA ANIL SURYAVANSHI

Software Engineer | Bharat Swabhiman Patanjali Social Activist | Speaker | Motivator | Yoga Trainer

More from Medium

Using the Angular async pipe

[Rxjs] Rxjs store for angular (rx-ng-store)2

Disabling Form Controls When Working With Reactive Forms in Angular

Angular Framework