cookbook - 1 to 2 初译完毕

This commit is contained in:
Zhicheng Wang 2016-06-02 09:07:31 +08:00
parent 1a66785970
commit 58dec1f30c
1 changed files with 334 additions and 334 deletions

View File

@ -1315,7 +1315,7 @@ block style-property-name-dart-diff
The directive calls `EventEmitter.emit(payload)` to fire an event, passing in a message payload that can be anything.
Parent directives listen for the event by binding to this property and accessing the payload through the `$event` object.
指令使用典型的Angular[EventEmitter](../api/core/EventEmitter-class.html)来触发自定义事件。
指令使用典型的Angular [EventEmitter](../api/core/EventEmitter-class.html)来触发自定义事件。
指令创建一个`EventEmitter`实例,并且把它作为一个属性暴露出来。
指令调用`EventEmitter.emit(payload)`来触发事件,传进去的消息载荷可以是任何东西。
父指令通过绑定到这个属性来监听这个事件,并且通过`$event`对象来访问这个载荷。
@ -1973,7 +1973,7 @@ block remember-the-brackets
That syntax assigns the *string* value "currentHero" to `ngIf`.
In JavaScript a non-empty string is a truthy value, so `ngIf` would always be
`true` and Angular would always display the `hero-detail`
even when there is no `currentHero`!
... even when there is no `currentHero`!
不要误写为`ngIf="currentHero"`
这种语法会把一个字符串"currentHero"赋值给`ngIf`。