From 251d4ffe6ce979b04608b0f512b23a42cfe7603d Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Sat, 6 Aug 2016 20:04:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BA=86=E5=AE=98=E6=96=B9?= =?UTF-8?q?=E7=9A=84=E6=9C=80=E6=96=B0=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../latest/cookbook/a1-a2-quick-reference.jade | 2 +- .../latest/cookbook/dependency-injection.jade | 8 ++++---- public/docs/ts/latest/glossary.jade | 2 +- public/docs/ts/latest/guide/animations.jade | 2 +- public/docs/ts/latest/guide/architecture.jade | 3 ++- public/docs/ts/latest/guide/index.jade | 2 +- public/docs/ts/latest/guide/router.jade | 17 ++++++++++++++--- public/docs/ts/latest/tutorial/toh-pt6.jade | 6 +++--- 8 files changed, 27 insertions(+), 15 deletions(-) diff --git a/public/docs/ts/latest/cookbook/a1-a2-quick-reference.jade b/public/docs/ts/latest/cookbook/a1-a2-quick-reference.jade index 36456deee5..42c4787d7e 100644 --- a/public/docs/ts/latest/cookbook/a1-a2-quick-reference.jade +++ b/public/docs/ts/latest/cookbook/a1-a2-quick-reference.jade @@ -11,7 +11,7 @@ a(id="top") :marked **See the Angular 2 syntax in this **. - **可到[在线范例](/resources/live-examples/cb-a1-a2-quick-reference/ts/plnkr.html)中查看Angular 2语法**。 + **可到中查看Angular 2语法**。 ## Contents diff --git a/public/docs/ts/latest/cookbook/dependency-injection.jade b/public/docs/ts/latest/cookbook/dependency-injection.jade index 4efb897d81..07945da12a 100644 --- a/public/docs/ts/latest/cookbook/dependency-injection.jade +++ b/public/docs/ts/latest/cookbook/dependency-injection.jade @@ -116,7 +116,7 @@ include ../_util-fns **See the ** of the code supporting this cookbook. - 要获取本“烹饪宝典”的代码,**参见[在线例子](/resources/live-examples/cb-dependency-injection/ts/plnkr.html)**。 + 要获取本“烹饪宝典”的代码,**参见**。 .l-main-section @@ -927,7 +927,7 @@ a(id='usefactory') Look at the for the full source code. - 该函数从`HeroService`获取英雄参赛者,从中取`2`个作为亚军,并把他们的名字拼接起来。请到[在线例子](/resources/live-examples/cb-dependency-injection/ts/plnkr.html)查看全部原代码。 + 该函数从`HeroService`获取英雄参赛者,从中取`2`个作为亚军,并把他们的名字拼接起来。请到查看全部原代码。 a(id="tokens") .l-main-section @@ -1200,7 +1200,7 @@ a(id='alex') the confirms that the `alex` parameter is set. - 安全起见,我们添加了[@Optional](#optional)装饰器,但是[在线例子](/resources/live-examples/cb-dependency-injection/ts/plnkr.html)显示`alex`参数确实被设置了。 + 安全起见,我们添加了[@Optional](#optional)装饰器,但是显示`alex`参数确实被设置了。 @@ -1257,7 +1257,7 @@ a(id='alex') confirms that the `alex` parameter is null. *We cannot inject a parent by its base class.* - 可惜这样不行。[在线例子](/resources/live-examples/cb-dependency-injection/ts/plnkr.html)显示`alex`参数是null。 + 可惜这样不行。显示`alex`参数是null。 *不能通过基类注入父组件*。 diff --git a/public/docs/ts/latest/glossary.jade b/public/docs/ts/latest/glossary.jade index 68b3495cc3..d09cf56f51 100644 --- a/public/docs/ts/latest/glossary.jade +++ b/public/docs/ts/latest/glossary.jade @@ -385,7 +385,7 @@ include _util-fns Angular makes similar requests internally during many of its operations as when it creates a [`Component`](#component) for display. - Angular在创建[组件(Component)](#AppComponent)以供显示的过程中,会在内部执行很多类似的依赖注入请求。 + Angular在创建[组件(Component)](#component)以供显示的过程中,会在内部执行很多类似的依赖注入请求。 The `Injector` maintains an internal map of tokens to dependency values. If the `Injector` can't find a value for a given token, it creates diff --git a/public/docs/ts/latest/guide/animations.jade b/public/docs/ts/latest/guide/animations.jade index b0d570b16b..b8d43bc48f 100644 --- a/public/docs/ts/latest/guide/animations.jade +++ b/public/docs/ts/latest/guide/animations.jade @@ -79,7 +79,7 @@ include ../_util-fns :marked The examples referenced in this chapter are available as a . - 本章中引用的这个例子可以到[在线例子](/resources/live-examples/animations/ts/plnkr.html)去体验。 + 本章中引用的这个例子可以到去体验。 a(id="example-transitioning-between-states") .l-main-section diff --git a/public/docs/ts/latest/guide/architecture.jade b/public/docs/ts/latest/guide/architecture.jade index fcce30b7b7..bf1a3aa852 100644 --- a/public/docs/ts/latest/guide/architecture.jade +++ b/public/docs/ts/latest/guide/architecture.jade @@ -212,7 +212,8 @@ block angular-library-modules `!{_at_angular}/http` and `!{_at_angular}/router`. We import what we need from an Angular !{_library_module}. - 还有另一些重要的Angular模块库,比如`@angular/common`、`@angular/router` 和 `@angular/http`。我们从一个Angular的!{_library_module}导入我们需要的模块。 + 还有另一些重要的Angular模块库,比如`@angular/common`、和 `@angular/http`和`@angular/router`。 + 我们从一个Angular的!{_library_module}导入我们需要的模块。 block angular-imports :marked diff --git a/public/docs/ts/latest/guide/index.jade b/public/docs/ts/latest/guide/index.jade index fe94782676..731b53401b 100644 --- a/public/docs/ts/latest/guide/index.jade +++ b/public/docs/ts/latest/guide/index.jade @@ -190,7 +190,7 @@ block example-links Look for a link to a running version of that sample near the top of each page, such as this from the [Architecture](architecture.html) chapter. - 在每页靠近顶部的地方都可以看到一个链接,指向这个范例的可执行版本,比如[架构](architecture.html)一章中的[在线例子](/resources/live-examples/architecture/ts/plnkr.html)。 + 在每页靠近顶部的地方都可以看到一个链接,指向这个范例的可执行版本,比如[架构](architecture.html)一章中的。 The link launches a browser-based code editor where we can inspect, modify, save, and download the code. diff --git a/public/docs/ts/latest/guide/router.jade b/public/docs/ts/latest/guide/router.jade index ceb84cc152..e946a26824 100644 --- a/public/docs/ts/latest/guide/router.jade +++ b/public/docs/ts/latest/guide/router.jade @@ -339,6 +339,9 @@ code-example(format="", language="html"). :marked ### Router State + + ### 路由器状态 + After the end of each successful navigation lifecycle, the router builds a tree of `ActivatedRoute`s, which make up the current state of the router. We can access the current `RouterState` from anywhere in our application using the `Router` service and the `routerState` property. @@ -526,8 +529,14 @@ table While we make incremental progress toward the ultimate sample application, this chapter is not a tutorial. We discuss code and design decisions pertinent to routing and application design. We gloss over everything in between. - + + 虽然我们会渐进式的前进到最终的范例应用,但本章并不是一个教程。 + 我们讨论路由和应用设计有关的代码和设计决策,并在这期间,处理遇到的所有问题。 + The full source is available in the [live example](/resources/live-examples/router/ts/plnkr.html). + + 完整代码可以在[在线例子](/resources/live-examples/router/ts/plnkr.html)中找到。 + :marked Our client is the Hero Employment Agency. Heroes need work and The Agency finds Crises for them to solve. @@ -545,6 +554,8 @@ table 1. A *Heroes* area where we maintain the list of heroes employed by The Agency. + 1. 一个*英雄*区,用来维护该中心雇佣英雄的列表。 + Run the [live example](/resources/live-examples/router/ts/plnkr.html). It opens in the *Crisis Center*. We'll come back to that. @@ -2746,7 +2757,7 @@ code-example(format="." language="bash"). row because it demonstrates the final state of the application which includes the steps we're *about* to cover. At the moment we're describing the state of affairs *prior* to those steps. - [在线例子](/resources/live-examples/router/ts/plnkr.html)*会*高亮显示选中的行,因为它显示的是应用中的最终状态,它包括一些我们*即将*涉及的步骤。接下来,我们就来讲讲这些中间步骤。 + *会*高亮显示选中的行,因为它显示的是应用中的最终状态,包括一些*即将*涉及的步骤。接下来,我们就来讲讲这些中间步骤。 :marked The `HeroListComponent` isn't expecting any parameters at all and wouldn't know what to do with them. @@ -2904,7 +2915,7 @@ figure.image-display Please visit the and where you can download the final source code. - 本章中涉及到了很多背景知识,而且本应用程序也太大了,所以没法在这里显示。请访问[在线例子](/resources/live-examples/router/ts/plnkr.html),在那里你可以下载最终的源码。 + 本章中涉及到了很多背景知识,而且本应用程序也太大了,所以没法在这里显示。请访问,在那里你可以下载最终的源码。 .l-main-section diff --git a/public/docs/ts/latest/tutorial/toh-pt6.jade b/public/docs/ts/latest/tutorial/toh-pt6.jade index 873c0c4148..33ac4fc68b 100644 --- a/public/docs/ts/latest/tutorial/toh-pt6.jade +++ b/public/docs/ts/latest/tutorial/toh-pt6.jade @@ -440,7 +440,7 @@ block hero-detail-comp-updates :marked In order to differentiate between add and edit we are adding a check to see if an id is passed in the URL. If the id is absent we bind `HeroDetailComponent` to an empty `Hero` object. In either case, any edits made through the UI will be bound back to the same `hero` property. - 为了区分添加和编辑操作,我们增加了一步检查,看看url中是否传入了id。如果没有id,我们就把`HeroDetailComponent`绑定到一个空的`Hero`对象。 + 为了区分添加和编辑操作,我们增加了一步检查,看看URL中是否传入了id。如果没有id,我们就把`HeroDetailComponent`绑定到一个空的`Hero`对象。 无论是哪种情况,通过UI进行的任何编辑操作都会被绑定回同一个`hero`属性。 :marked @@ -672,7 +672,7 @@ block observables-section-intro As the user types a name into a search box, we'll make repeated HTTP requests for heroes filtered by that name. 我们要为《英雄指南》添加一个*英雄搜索*特性。 - 当用户在搜索框中输入一个名字时,我们将不断发起http请求,以获得按名字过滤的英雄。 + 当用户在搜索框中输入一个名字时,我们将不断发起HTTP请求,以获得按名字过滤的英雄。 We start by creating `HeroSearchService` that sends search queries to our server's web api. @@ -724,7 +724,7 @@ block observables-section-intro The `async` pipe subscribes to the `!{_Observable}` and produces the !{_array} of heroes to `*ngFor`. 但是,接下来我们看到`heroes`属性现在是英雄列表的`Observable`对象,而不再只是英雄数组。 - `*ngFor`不能利用可观察对象做任何事,除非我们在它后面跟一个`async` pipe (`AsyncPipe`)。 + `*ngFor`不能用可观察对象做任何事,除非我们在它后面跟一个`async` pipe (`AsyncPipe`)。 这个`async`管道会订阅到这个可观察对象,并且为`*ngFor`生成一个英雄数组。 Time to create the `HeroSearchComponent` class and metadata.