fix: attribute-directives.
This commit is contained in:
parent
f6d2b39844
commit
17ef4622e7
|
@ -36,6 +36,7 @@ a#directive-overview
|
||||||
## 指令概览
|
## 指令概览
|
||||||
|
|
||||||
There are three kinds of directives in Angular:
|
There are three kinds of directives in Angular:
|
||||||
|
|
||||||
在Angular中有三种类型的指令:
|
在Angular中有三种类型的指令:
|
||||||
|
|
||||||
1. Components—directives with a template.
|
1. Components—directives with a template.
|
||||||
|
@ -57,6 +58,7 @@ a#directive-overview
|
||||||
|
|
||||||
*Attribute directives* are used as attributes of elements. The built-in [NgStyle](template-syntax.html#ngStyle) directive in the [Template Syntax](template-syntax.html) page, for example,
|
*Attribute directives* are used as attributes of elements. The built-in [NgStyle](template-syntax.html#ngStyle) directive in the [Template Syntax](template-syntax.html) page, for example,
|
||||||
can change several element styles at the same time.
|
can change several element styles at the same time.
|
||||||
|
|
||||||
*属性型*指令改变一个元素的外观或行为。比如,内置的[NgStyle](template-syntax.html#ngStyle)指令可以同时修改元素的多种样式。
|
*属性型*指令改变一个元素的外观或行为。比如,内置的[NgStyle](template-syntax.html#ngStyle)指令可以同时修改元素的多种样式。
|
||||||
|
|
||||||
.l-main-section
|
.l-main-section
|
||||||
|
@ -221,6 +223,7 @@ p
|
||||||
+makeExample('attribute-directives/ts/app/app.component.1.html',null,'app/app.component.html')(format=".")
|
+makeExample('attribute-directives/ts/app/app.component.1.html',null,'app/app.component.html')(format=".")
|
||||||
:marked
|
:marked
|
||||||
Now reference this template in the `AppComponent`:
|
Now reference this template in the `AppComponent`:
|
||||||
|
|
||||||
现在,引用`AppComponent`的模板:
|
现在,引用`AppComponent`的模板:
|
||||||
+makeExample('attribute-directives/ts/app/app.component.ts',null,'app/app.component.ts')
|
+makeExample('attribute-directives/ts/app/app.component.ts',null,'app/app.component.ts')
|
||||||
:marked
|
:marked
|
||||||
|
@ -540,8 +543,9 @@ figure.image-display
|
||||||
## 总结
|
## 总结
|
||||||
|
|
||||||
This page covered how to:
|
This page covered how to:
|
||||||
|
|
||||||
本章介绍了如何:
|
本章介绍了如何:
|
||||||
- [Build a simple **attribute directive** to attach behavior to an HTML element](#write-directive).
|
- [Build a simple **attribute directive** to attach behavior to an HTML element](#write-directive)
|
||||||
- [构建一个简单的**属性型指令**来为一个HTML元素添加行为](#write-directive),
|
- [构建一个简单的**属性型指令**来为一个HTML元素添加行为](#write-directive),
|
||||||
- [Use that directive in a template](#apply-directive).
|
- [Use that directive in a template](#apply-directive).
|
||||||
- [在模板中使用那个指令](#apply-directive),
|
- [在模板中使用那个指令](#apply-directive),
|
||||||
|
|
Loading…
Reference in New Issue