December 2017
Beginner
372 pages
10h 32m
English
As we discussed templates in the previous chapter, we will just have an overview of the templates here. Our focus here will be on data binding and directives.
We have seen, when we created our components, that we had a separate file for our HTML components. The reference to this file was defined in the templateUrl property of the component metadata in the component class. When Angular loads the component, it checks the component metadata for various properties such as where the template resides and where the CSS resides. On identifying the template, Angular then processes and renders the component's HTML on the page.
Angular provides a couple of ways of defining templates for a component:
Read now
Unlock full access