# Template syntax
# 模板语法
In Angular, a *template* is a chunk of HTML.
Within a template, you can use special syntax to leverage many of Angular's features.
在 Angular 中,*模板*就是一块 HTML。在模板中,你可以通过一种特殊语法来使用 Angular 的许多功能。
## Prerequisites
## 先决条件
Before learning template syntax, you should be familiar with the following:
在学习模板语法之前,你应该熟悉下列内容:
* [Angular concepts](guide/architecture)
[Angular 的概念](guide/architecture)
* JavaScript
* HTML
* CSS
Each Angular template in your app is a section of HTML that you can include as a part of the page that the browser displays.
An Angular HTML template renders a view, or user interface, in the browser, just like regular HTML, but with a lot more functionality.
应用程序中的每个 Angular 模板都是一块 HTML,你可以将其包含在浏览器显示的页面中。 Angular 中的 HTML 模板与常规 HTML 一样,可以在浏览器中渲染视图或用户界面,但功能要多得多。
When you generate an Angular app with the Angular CLI, the `app.component.html` file is the default template containing placeholder HTML.
使用 Angular CLI 生成 Angular 应用时, `app.component.html` 文件是一个包含占位符 HTML 的默认模板。
The template syntax guides show you how you can control the UX/UI by coordinating data between the class and the template.
本模板语法指南向你展示了如何通过协调类和模板之间的数据来控制 UX/UI。
Most of the Template Syntax guides have dedicated working example apps that demonstrate the individual topic of each guide.
To see all of them working together in one app, see the comprehensive .
大多数模板语法指南都有专门的可工作的范例应用,这些应用程序演示了每个指南中的各个主题。要查看把所有应用合在一起时的工作情况,请参阅综合。
## Empower your HTML
## 增强你的 HTML
With special Angular syntax in your templates, you can extend the HTML vocabulary of your apps.
For example, Angular helps you get and set DOM (Document Object Model) values dynamically with features such as built-in template functions, variables, event listening, and data binding.
通过在模板中使用 Angular 的特有语法,你可以扩展应用程序的 HTML 词汇表。例如,Angular 可以通过内置的模板函数、变量、事件监听和数据绑定等功能来帮助你动态获取和设置 DOM(文档对象模型)中的值。
Almost all HTML syntax is valid template syntax.
However, because an Angular template is part of an overall webpage, and not the entire page, you don't need to include elements such as ``, ``, or ``.
You can focus exclusively on the part of the page you are developing.
几乎所有的 HTML 语法都是有效的模板语法。但是,由于 Angular 模板只是整个网页的一部分,而不是整个网页,因此你不需要包含诸如 `` , `` 或 `` 元素。这样你可以专注于正在开发的那部分页面。
To eliminate the risk of script injection attacks, Angular does not support the `