Components are like the basic building block in an Angular application. Components are defined using the @component decorator. A component has a selector, template, style and other properties, using which it specifies the metadata required to process the component.
Angular creates, updates, and destroys components as the user moves through the application
The metadata for a component tells Angular where to get the major building blocks that it needs to create and present the component and its view. In particular, it associates a template with the component, either directly with inline code, or by reference. Together, the component and its template describe a view.
selector: A CSS selector that tells Angular to create and insert an instance of this component wherever it finds the corresponding tag in template HTML. For example, if an app's HTML contains "app-hero-list", then Angular inserts an instance of the HeroListComponent view between those tags.
templateUrl: The module-relative address of this component's HTML template. Alternatively, you can provide the HTML template inline, as the value of the template property. This template defines the component's host view.
providers: An array of providers for services that the component requires. In the example, this tells Angular how to provide the HeroService instance that the component's constructor uses to get the list of heroes to display.
Templates and views
You define a component's view with its companion template. A template is a form of HTML that tells Angular how to render the component.
Views are typically arranged hierarchically, allowing you to modify or show and hide entire UI sections or pages as a unit. The template immediately associated with a component defines that component's host view. The component can also define a
Watch video Angular 8 2020 | What is Component in Angular Application #6 online without registration, duration hours minute second in high quality. This video was added by user Technical Babaji (Tarique Akhtar) 22 January 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,358 once and liked it 28 people.