Components in Angular 8 Last Updated : 04 Nov, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The component is the basic building block of Angular. It has a selector, template, style, and other properties, and it specifies the metadata required to process the component. Creating a Component in Angular 8: To create a component in any angular application, follow the below steps: Get to the angular app via your terminal.Create a component using the following command:ng g c <component_name> OR ng generate component <component_name> Following files will be created after generating the component: Using a component in Angular 8: Go to the component.html file and write the necessary HTML code.Go to the component.css file and write the necessary CSS code.Write the corresponding code in component.ts file.Run the Angular app using ng serve --open Implementation code: Please note that the name of the component in the below code is gfg component. gfg.component.html: html <h1>GeeksforGeeks</h1> gfg.component.css: javascript h1{ color: green; font-size: 30px; } gfg.component.ts: javascript import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-gfg', templateUrl: './gfg.component.html', styleUrls: ['./gfg.component.css'] }) export class GfgComponent{ a ="GeeksforGeeks"; } app.module.ts: javascript import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { GfgComponent } from './gfg/gfg.component'; @NgModule({ imports: [ BrowserModule ], declarations: [ AppComponent, GfgComponent ], bootstrap: [ AppComponent ] }) export class AppModule { } Output: Comment More infoAdvertise with us Next Article Component Lifecycle in Angular A agamjyot08 Follow Improve Article Tags : Web Technologies AngularJS AngularJS-Basics Similar Reads Angular 7 | Components Components in angular are similar to pages in a website. Components are a key feature in angular. They are well optimized as compared to pages because they are lightweight and reusable in nature. Creating a Component in angular 7: To create a component in any angular application, the first step is t 2 min read Angular Components Overview Angular Components are the building blocks of Angular applications, containing the template, styles, and behavior of a part of the user interface. This article provides an overview of Angular components, including their structure, features, and how to create and use them effectively. Table of Conten 6 min read Standalone Components In Angular In Angular, standalone components are a new feature that allows you to create components without the need for a module. This can simplify your application structure and reduce boilerplate code. This article will guide you through the concept of standalone components, including different approaches, 4 min read Angular PrimeNG Dock Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. It provides a lot of templates, components, theme design, an extensive icon library, and much more. 4 min read Component Lifecycle in Angular In Angular, Components are the fundamental building blocks of an application. Understanding the lifecycle of these components is crucial for effective Angular Development. Angular provides several lifecycle hooks that allow developers to tap into key moments in a Componentâs lifecycle and execute cu 3 min read Angular PrimeNG Tree Component Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. It provides a lot of templates, components, theme design, an extensive icon library, and much more. 6 min read Like