Yogesh Chauhan's Blog

What are components in Angular?

in Angular on May 11, 2020

💡 Components define areas of responsibility in the user interface, or UI, that let you reuse sets of UI functionality. 

A component consists of three things:

1. A component class that handles data and functionality.

In this post, Five Common Features Of Angular's Template Syntax (With Examples), the product data and the share() method in the component class handle data and functionality, respectively.

2. An HTML template that determines the UI.

In this post, Five Common Features Of Angular's Template Syntax (With Examples), the product list's HTML template displays the name, description, and a "Share" button for each product.

3. Component-specific styles that define the look and feel.

Though product list does not define any styles in this post, Five Common Features Of Angular's Template Syntax (With Examples), this is where component CSS resides.

An Angular application comprises a tree of components, in which each Angular component has a specific purpose and responsibility.

You can add more components by just clicking on "New Component" in the browser window when you run your Angular application. 


Most Read

#1 How to check if radio button is checked or not using JavaScript? #2 How to add Read More Read Less Button using JavaScript? #3 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #4 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #5 How to uninstall Cocoapods from the Mac OS? #6 PHP Login System using PDO Part 1: Create User Registration Page

Recently Posted

#Apr 8 JSON.stringify() in JavaScript #Apr 7 Middleware in NextJS #Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface
You might also like these
12 URLSearchParams methods in JavaScriptJavaScriptWhat is React? Learn the basicsReactHow to convert an object from API to JSON array in Angular 9?AngularHow to clean up after a plugin uninstall in WordPress?WordPressIntroduction to components and templates Part 3: Data bindingAngularHow to disable scrolling on html body on menu click using JavaScript?JavaScriptTwo ways we can use colon(:) in Envision BasicEnvision BasicThe fundamental difference between HAVING and WHERE clauses in PostgresPostgresHow to display and animate image on scroll using JavaScript?JavaScriptIntroduction to components and templates Part 4: Pipes and DirectivesAngularHow to Remove PHP File Extensions From Your Website URLs?PHPWhat’s a Log File and What are Log File Monitors?Miscellaneous