Reader small image

You're reading from  Angular Design Patterns and Best Practices

Product typeBook
Published inFeb 2024
Reading LevelIntermediate
PublisherPackt
ISBN-139781837631971
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Alvaro Camillo Neto
Alvaro Camillo Neto
author image
Alvaro Camillo Neto

Alvaro is a software engineer, speaker and instructor in Brazil. He works in the technology industry for over 10 years dedicated to the development of business solutions in a large company in the industry. Alvaro is a technology enthusiast and sees knowledge sharing as an opportunity to help the community that helped him so much and the best way of learning. He has performed from small meetups to large events focusing on the themes of developing web solutions. He also shares knowledge on his blog and participates in the organization of AngularSP.
Read more about Alvaro Camillo Neto

Right arrow

Creating components

Every interface created with Angular is a component in the architecture of the framework; therefore, theoretically, we could have our entire application in a single component.

As we studied in Chapter 2, Organizing Your Application, it is best to separate your application into modules, and with components, we use the same reasoning by separating our interfaces into and composing them with different components, maximizing reuse and maintainability.

In this chapter, we will illustrate this with a gym diary application, as shown in the following figure – to focus on Angular, we will not use Angular Material, only HTML, CSS (in this case, Tailwind CSS), and TypeScript.

Figure 4.1 – Gym diary application UI

Figure 4.1 – Gym diary application UI

In this initial example, we created a component with just the HTML template and the CSS and TypeScript files are as they were created by Angular CLI. Here’s the top of the page first:

<div class="...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Angular Design Patterns and Best Practices
Published in: Feb 2024Publisher: PacktISBN-13: 9781837631971

Author (1)

author image
Alvaro Camillo Neto

Alvaro is a software engineer, speaker and instructor in Brazil. He works in the technology industry for over 10 years dedicated to the development of business solutions in a large company in the industry. Alvaro is a technology enthusiast and sees knowledge sharing as an opportunity to help the community that helped him so much and the best way of learning. He has performed from small meetups to large events focusing on the themes of developing web solutions. He also shares knowledge on his blog and participates in the organization of AngularSP.
Read more about Alvaro Camillo Neto