From 64b9e476fbff79adb61f38a1129964777a5fa249 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Tue, 21 Jun 2016 07:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8Aalternative=E7=BB=9F=E4=B8=80=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=A4=87=E9=80=89=E6=88=96=E6=9B=BF=E4=BB=A3=E5=93=81?= =?UTF-8?q?=EF=BC=88=E5=8F=96=E5=86=B3=E4=BA=8E=E8=AF=AD=E5=A2=83=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/docs/ts/latest/cookbook/dependency-injection.jade | 8 ++++---- public/docs/ts/latest/guide/architecture.jade | 2 +- public/docs/ts/latest/guide/dependency-injection.jade | 4 ++-- public/docs/ts/latest/guide/server-communication.jade | 2 +- public/docs/ts/latest/guide/style-guide.jade | 2 +- public/docs/ts/latest/guide/template-syntax.jade | 8 ++++---- public/docs/ts/latest/quickstart.jade | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/public/docs/ts/latest/cookbook/dependency-injection.jade b/public/docs/ts/latest/cookbook/dependency-injection.jade index b1735a2151..37da274b5b 100644 --- a/public/docs/ts/latest/cookbook/dependency-injection.jade +++ b/public/docs/ts/latest/cookbook/dependency-injection.jade @@ -66,7 +66,7 @@ include ../_util-fns [Define providers with object literals](#object-literals) - [使用对象文本定义供应商] (#object-literals) + [使用对象字面量定义供应商] (#object-literals) [Provider token alternatives](#tokens) @@ -696,7 +696,7 @@ figure.image-display The `HeroOfTheMonthComponent` example demonstrates many of the alternatives and why we need them. - `HeroOfTheMonthComponent`例子示范了一些备选方案,展示了为什么需要它们。 + `HeroOfTheMonthComponent`例子示范了一些替代方案,展示了为什么需要它们。 figure.image-display img(src="/resources/images/cookbooks/dependency-injection/hero-of-month.png" alt="Hero of the month" width="300px") @@ -789,7 +789,7 @@ a(id='useclass') The alternative could implement a different strategy, extend the default class, or fake the behavior of the real class in a test case. - 使用该技术来为公共或默认类***提供候选实现***。该候选项能实现一个不同的策略,比如拓展默认类或者在测试的时候假冒真实类。 + 使用该技术来为公共或默认类***提供备选实现***。该替代品能实现一个不同的策略,比如拓展默认类或者在测试的时候假冒真实类。 We see two examples in the `HeroOfTheMonthComponent`: @@ -933,7 +933,7 @@ a(id="tokens") :marked ## Provider token alternatives: the *class-interface* and *OpaqueToken* - ## 可选供应商令牌:*类-接口*和*OpaqueToken* + ## 备选供应商令牌:*类-接口*和*OpaqueToken* Angular dependency injection is easiest when the provider *token* is a class that is also the type of the returned dependency object (what we usually call the *service*). diff --git a/public/docs/ts/latest/guide/architecture.jade b/public/docs/ts/latest/guide/architecture.jade index 378ef05ea1..ae10bd72e4 100644 --- a/public/docs/ts/latest/guide/architecture.jade +++ b/public/docs/ts/latest/guide/architecture.jade @@ -186,7 +186,7 @@ figure For example, we import the Angular **`Component` *function*** from the *@angular/core* module like this: 从Angular模块库中导入所需内容的方式都差不多。 - 比如,从*@angular2/core*中导入Angular **`Component`*函数***的代码是这样的: + 比如,从*@angular/core*中导入Angular **`Component`*函数***的代码是这样的: +makeExample('architecture/ts/app/app.component.ts', 'import')(format=".") :marked diff --git a/public/docs/ts/latest/guide/dependency-injection.jade b/public/docs/ts/latest/guide/dependency-injection.jade index 9b6fc90142..c2fe895c5d 100644 --- a/public/docs/ts/latest/guide/dependency-injection.jade +++ b/public/docs/ts/latest/guide/dependency-injection.jade @@ -787,7 +787,7 @@ code-example(format="nocode"). We could give it a provider that calls a logger factory function. Any of these approaches might be a good choice under the right circumstances. - 我们可以使用另外的各种供应商来配置这个注入器,只要它们能交付#{objectlikeCn}`Logger`就可以了。 + 我们可以使用其它备选供应商来配置这个注入器,只要它们能交付#{objectlikeCn}`Logger`就可以了。 我们可以提供一个替身类。#{loggerlikeCn} 我们可以给它一个供应商,让它调用一个可以创建日志服务的工厂函数。 所有这些方法,只要用在正确的场合,都可能是一个好的选择。 @@ -839,7 +839,7 @@ block provider-ctor-args :marked ### Alternative class providers - ### 其他的“类”供应商 + ### 备选的“类”供应商 Occasionally we'll ask a different class to provide the service. The following code tells the injector diff --git a/public/docs/ts/latest/guide/server-communication.jade b/public/docs/ts/latest/guide/server-communication.jade index 4fc6992c01..a82c6ab0c0 100644 --- a/public/docs/ts/latest/guide/server-communication.jade +++ b/public/docs/ts/latest/guide/server-communication.jade @@ -826,7 +826,7 @@ h2#cors 跨域请求:Wikipedia范例 Some servers do not support CORS but do support an older, read-only alternative called [JSONP](https://en.wikipedia.org/wiki/JSONP). Wikipedia is one such server. - 有些服务器不支持CORS,但支持一种老的、只读的(译注:即仅支持GET)替代协议,这就是[JSONP](https://en.wikipedia.org/wiki/JSONP)。 + 有些服务器不支持CORS,但支持一种老的、只读的(译注:即仅支持GET)备选协议,这就是[JSONP](https://en.wikipedia.org/wiki/JSONP)。 Wikipedia就是一个这样的服务器。 .l-sub-section :marked diff --git a/public/docs/ts/latest/guide/style-guide.jade b/public/docs/ts/latest/guide/style-guide.jade index c25e9dd7d1..8b13dd88e0 100644 --- a/public/docs/ts/latest/guide/style-guide.jade +++ b/public/docs/ts/latest/guide/style-guide.jade @@ -2228,7 +2228,7 @@ a(href="#toc") 回到顶部 :marked **Why?** Angular allows for an [alternative syntax](https://angular.io/docs/ts/latest/guide/template-syntax.html#!#binding-syntax) `on-*`. If the event itself was prefixed with `on` this would result in an `on-onEvent` binding expression. - **为何?**Angular允许[可选语法](https://angular.io/docs/ts/latest/guide/template-syntax.html#!#binding-syntax) `on-*`。如果事件的名字本身带有前缀`on`,那么绑定的表达式可能是`on-onEvent`。 + **为何?**Angular允许[另一种备选语法](https://angular.io/docs/ts/latest/guide/template-syntax.html#!#binding-syntax) `on-*`。如果事件的名字本身带有前缀`on`,那么绑定的表达式可能是`on-onEvent`。 +makeExample('style-guide/ts/05-16/app/heroes/hero.component.avoid.ts', 'example', 'app/heroes/hero.component.ts')(avoid=1) :marked diff --git a/public/docs/ts/latest/guide/template-syntax.jade b/public/docs/ts/latest/guide/template-syntax.jade index 7a9db38a71..fbafddee1e 100644 --- a/public/docs/ts/latest/guide/template-syntax.jade +++ b/public/docs/ts/latest/guide/template-syntax.jade @@ -236,7 +236,7 @@ block template-expressions-cannot A [template reference variable](#ref-vars) is one such alternative context object. 表达式的上下文也包括组件之外的对象。 - [模板引用变量](#ref-vars)就是另外的上下文对象之一。 + [模板引用变量](#ref-vars)就是备选的上下文对象之一。 :marked @@ -403,7 +403,7 @@ block statement-context representing the "message" or "payload" of the raised event. 语句上下文可以包含组件之外的对象。 - [模板引用对象](#ref-vars)就是这些候选上下文对象中的一个。 + [模板引用对象](#ref-vars)就是这些备选上下文对象中的一个。 在事件绑定语句中,我们将频繁的看到被保留的`$event`符号,它代表来自所触发事件的“消息”或“有效载荷”。 ### Statement guidelines @@ -980,7 +980,7 @@ a(id="one-time-initialization") In fact, Angular translates those interpolations into the corresponding property bindings before rendering the view. - 在多数情况下,插值表达式是一个更方便的选择。实际上,在渲染视图之前,Angular就把这些插值表达式翻译成了对应的属性绑定形式。 + 在多数情况下,插值表达式是一个更方便的备选项。实际上,在渲染视图之前,Angular就把这些插值表达式翻译成了对应的属性绑定形式。 There is no technical reason to prefer one form to the other. We lean toward readability, which tends to favor interpolation. @@ -1237,7 +1237,7 @@ block style-property-name-dart-diff :marked Some people prefer the `on-` prefix alternative, known as the *canonical form*: - 有些人更喜欢带`on-`前缀的可选形式,称之为*规范形式*: + 有些人更喜欢带`on-`前缀的备选形式,称之为*规范形式*: +makeExample('template-syntax/ts/app/app.component.html', 'event-binding-2')(format=".") :marked Element events may be the more common targets, but Angular looks first to see if the name matches an event property diff --git a/public/docs/ts/latest/quickstart.jade b/public/docs/ts/latest/quickstart.jade index 76a1b65e8c..ed729881d0 100644 --- a/public/docs/ts/latest/quickstart.jade +++ b/public/docs/ts/latest/quickstart.jade @@ -605,7 +605,7 @@ h2#index 步骤4:添加#[code index.html] 本“快速起步”使用SystemJS来加载应用和库模块。 [以前](#add-config-files)我们曾把`systemjs.config.js`文件添加到项目的根目录。 - 还有一些其它候选者也能很好地工作,比如备受推崇的[webpack](guide/webpack.html)。 + 还有另一些替代方案也能很好的工作,比如备受推崇的[webpack](guide/webpack.html)。 SystemJS是一个好的选择,但要清楚,它只是“选择之一”,而不是“首选项”。 All module loaders require configuration and all loader configuration