Angular templates


Angular templates

A template in Angular is a piece of HTML. To take advantage of many of Angular's features, use special syntax within a template.

Each Angular template in your application is a piece of HTML that the browser will show as part of the page. Like conventional HTML, an Angular HTML template generates a view or user interface in the browser but with more capabilities.

The app.component.html file is the default template for Angular applications generated using the Angular CLI. It contains placeholder HTML.

Template Expressions

A template expression generates a value and is enclosed by double curly braces, {{ }}.
Angular resolves the expression and assigns it to a binding target's property. An HTML element, a component, or a directive could be the target.

Template Syntax

A template resembles conventional HTML, but it also contains Angular template syntax, which modifies the HTML based on the logic of your application and the state of the application and DOM data. Data binding may be used to coordinate application and DOM data, pipes can be used to alter data before it is displayed, and directives can be used to apply application logic to what is displayed in your template.

Template statements

In HTML, template statements are methods or attributes that can respond to user events. Your application can interact with users by presenting dynamic content or submitting forms using template statements.