Understanding Templates
AngularJS templates are fairly straightforward yet very powerful and easy to extend. Templates are based on standard HTML documents but extend the HTML functionality with three additional components:
■ Expressions: Expressions are bits of JavaScript-like code that are evaluated within the context of a scope. Expressions are denoted by {{}} brackets. The results of an expression are added to a compiled HTML web page. Expressions can be placed in normal HTML text or in the values of attributes, as shown here:
<p>{{1+2}}</p>href="/myPage.html/{{hash}}"
■ Filters: Filters transform the appearance of data that is placed on a web page. For example, a filter can convert a number from the scope into a currency string or a time ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access