partial review of template-syntax.jade.
This commit is contained in:
parent
070dd1c9e1
commit
7cb918a800
|
@ -9,12 +9,12 @@ block includes
|
|||
:marked
|
||||
Our Angular application manages what the user sees and can do, achieving this through the interaction of a Component class instance (the *component*) and its user-facing template.
|
||||
|
||||
我们的Angular应用管理着用户之所见和所为,并通过组件类的实例以及组件面向用户的模板来与用户交互。
|
||||
我们的Angular应用管理着用户之所见和所为,并通过组件的类实例和面向用户的模板来与用户交互。
|
||||
|
||||
Many of us are familiar with the component/template duality from our experience with model-view-controller (MVC) or model-view-viewmodel (MVVM). In Angular, the component plays the part of the controller/viewmodel, and the template represents the view.
|
||||
|
||||
从使用模型-视图-控制器(MVC)或模型-视图-视图模型(MVVM)的经验中,很多用户都熟悉了组件/模板这两个概念。
|
||||
在Angular中,组件扮演着控制器或视图模型部分,模板则扮演视图部分。
|
||||
在Angular中,组件扮演着控制器或视图模型的角色,模板则扮演视图的角色。
|
||||
|
||||
Let’s find out what it takes to write a template for our view. We’ll cover these basic elements of template syntax:
|
||||
|
||||
|
@ -83,11 +83,11 @@ code-example(language="html" escape="html").
|
|||
:marked
|
||||
Almost all HTML syntax is valid template syntax. The `<script>` element is a notable exception; it is forbidden, eliminating the risk of script injection attacks. (In practice, `<script>` is simply ignored.)
|
||||
|
||||
几乎所有的HTML语法都是有效的模板语法。但值得注意的例外是`<script>`元素,它被禁用了,以阻止脚本注入攻击的风险。(在实践中,`<script>`只是被简单的忽略了。)
|
||||
几乎所有的HTML语法都是有效的模板语法。但值得注意的例外是`<script>`元素,它被禁用了,以阻止脚本注入攻击的风险。(在实践中,`<script>`只是被忽略了。)
|
||||
|
||||
Some legal HTML doesn’t make much sense in a template. The `<html>`, `<body>`, and `<base>` elements have no useful role in our repertoire. Pretty much everything else is fair game.
|
||||
|
||||
在模板中,有些合法的HTML不会被用户感知到。`<html>`、`<body>`和`<base>`元素在我们的舞台上中并没有扮演有用的角色。对所有其它的元素则一视同仁。
|
||||
在模板中,有些合法的HTML没有理由被用在一个模板中。`<html>`、`<body>`和`<base>`元素在我们的舞台上中并没有扮演有用的角色。基本上所有其它的元素都被平等使用。
|
||||
|
||||
We can extend the HTML vocabulary of our templates with components and directives that appear as new elements and attributes. And we are about to learn how to get and set DOM values dynamically through data binding.
|
||||
|
||||
|
|
Loading…
Reference in New Issue