In this section, you will learn about different ways to include templates in the component view. There are two ways to include Template Syntax in the component syntax:
- We can define the view template inside the component decorator. Using template, we can include the template inline in the component decorator.
- We can also include the template using templateURL. Using templateUrl, we write the template elements in a separate file and provide the path of the template to the component.
templateURL is a much preferred way since it allows us to separate the code in a logical way to organize it more effectively.