...

/

Component Templates and Styling Components

Component Templates and Styling Components

We're going to take a quick look at the HTML templates and the ways for styling our components.

What is a template?

We’ve spent a lot of time looking at the component class, but now we’ll look at the template of the component.

The template is the visual part of the component that a user of your application will see.

A template can be as simple as a single line of HTML to a fully-featured web page. Within the template, we can define all the parts of the application the user can interact with, including forms, buttons, images, and even other Angular components , either the ones you’ve created yourself or third-party library components.

Types of templates

There are two ways a template can be attached to a component:

  • By using external template file approach
  • By using the inline template approach

Let’s have a look at each version.

External template


...