Categories of Components
Explore the different categories of Angular components, focusing on how presentational and smart components serve distinct roles. Understand how to plan components by separating visual display from data management, helping you design modular and maintainable applications. This lesson guides you through effective component organization within Angular.
When planning out your Angular application, it helps to think of components belonging to certain categories. These categories define the type of action that the component has been designed to perform.
For example, a component that just shows visual elements like a form or a button could be categorized as a visual component, while a component that performs non-visual tasks like loading data via a service can be categorized as a smart component.
Thinking of the types of categories that our components can belong to helps when we are planning and designing how our application will work to break down the functionality of the application into small, manageable chunks or components. Let’s have a look at some of the types of categories we can use for our components.
Presentational components
The role of a presentational component is to show something visually to the user.
Example 1: Show a list of items using repetitive code
For example, you may have a list of items you want ...