This commit is contained in:
Rex Ye 2016-05-16 17:06:59 +01:00
commit 5a0a53a022
5 changed files with 298 additions and 266 deletions

View File

@ -202,7 +202,7 @@ figure.image-display
The child component exposes an `EventEmitter` property with which it `emits`events when something happens. The parent binds to that event property and reacts to those events. The child component exposes an `EventEmitter` property with which it `emits`events when something happens. The parent binds to that event property and reacts to those events.
子级组件暴露一个`EventEmitter`属性,当事情发生时,子级组件利用该属性`散发`事件。父级绑定这个事件属性,并在事件发生时作出回应。 子级组件暴露一个`EventEmitter`属性,当事情发生时,子级组件利用该属性`emits`事件。父级绑定这个事件属性,并在事件发生时作出回应。
The child's `EventEmitter` property is an ***output property***, typically adorned with an [@Output decoration](../guide/template-syntax.html#inputs-outputs) as seen in this `VoterComponent`: The child's `EventEmitter` property is an ***output property***, typically adorned with an [@Output decoration](../guide/template-syntax.html#inputs-outputs) as seen in this `VoterComponent`:

View File

@ -88,7 +88,7 @@ code-example(format='')
Let's inject the `Title` service into the root `AppComponent` and expose a bindable `setTitle` method that calls it: Let's inject the `Title` service into the root `AppComponent` and expose a bindable `setTitle` method that calls it:
让我们把`Title`服务注入到根`AppComponent`组件,并暴可以绑定的`setTitle`方法来调用该服务: 让我们把`Title`服务注入到根`AppComponent`组件,并暴可以绑定的`setTitle`方法来调用该服务:
+makeExample( "cb-set-document-title/ts/app/app.component.ts", "class", "app/app.component.ts (class)" )(format='.') +makeExample( "cb-set-document-title/ts/app/app.component.ts", "class", "app/app.component.ts (class)" )(format='.')
:marked :marked

File diff suppressed because it is too large Load Diff

View File

@ -85,7 +85,7 @@ code-example(format="." language="bash").
### 导出英雄们 ### 导出英雄们
Lets create a property in `AppComponent` that exposes the heroes for binding. Lets create a property in `AppComponent` that exposes the heroes for binding.
我们在`AppComponent`上创建一个属性,用来导出这些英雄,以供绑定。 我们在`AppComponent`上创建一个属性,用来暴露这些英雄,以供绑定。
+makeExample('toh-2/ts-snippets/app.component.snippets.pt2.ts', 'hero-array-1', 'app.component.ts (英雄数组属性)') +makeExample('toh-2/ts-snippets/app.component.snippets.pt2.ts', 'hero-array-1', 'app.component.ts (英雄数组属性)')

View File

@ -169,7 +169,7 @@ code-example(format="." language="bash").
* `export` it so we can reference it during bootstrapping in `main.ts`. * `export` it so we can reference it during bootstrapping in `main.ts`.
* `export`它,以便我们能在`main.ts`的启动期间引用它。 * `export`它,以便我们能在`main.ts`的启动期间引用它。
* expose an application `title` property. * expose an application `title` property.
* 导出应用的`title`属性。 * 暴露应用的`title`属性。
* add the `@Component` metadata decorator above the class with a `my-app` selector. * add the `@Component` metadata decorator above the class with a `my-app` selector.
* 在类的上方添加`@Component`元数据装饰器,装饰器中带有`my-app`选择器。 * 在类的上方添加`@Component`元数据装饰器,装饰器中带有`my-app`选择器。
* add a template with `<h1>` tags surrounding a binding to the `title` property. * add a template with `<h1>` tags surrounding a binding to the `title` property.