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 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #3 How to add Read More Read Less Button using JavaScript? #4 How to uninstall Cocoapods from the Mac OS? #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to Use SQL MAX() Function with Dates?

Recently Posted

#Aug 15 Is PHP still good for back-end programming? #Aug 10 How to create a multisite network in WordPress? #Aug 3 How to create a circle that follows a cursor using JavaScript and CSS? #Aug 3 How to make a curtain slider using jQuery and CSS? #Aug 2 How to progressively load images and add a blurry placeholder? #Aug 1 How to create a placeholder loader (throbber) using CSS?
You might also like these
How to Write Complex Search Queries in SQL?SQL/MySQLHow to Use the EXISTS and NOT EXISTS Operator with a Subquery in SQL and MySQL?SQL/MySQLHow to create a placeholder loader (throbber) using CSS?CSSWhat is Object Mutability in JavaScript?JavaScriptHow to make a web page look good on any device?HTMLSafe Practice to add Links to cross-origin destinationUI/UXHow to add and remove capabilities from a role in WordPress?WordPressHow to create a blurry text effect using CSS?CSSWordPress: How to find all posts from a custom post type with multiple custom fields values?WordPressHow to check if the page is the home page in WordPress?WordPress10 Usability Blunders to AvoidUI/UXCreate a menu with a curtain falling animation using CSS and JavaScriptCSS