Learn more in the [Attribute Directives](guide/attribute-directives) and [Structural Directives](guide/structural-directives) guides.
diff --git a/aio/content/guide/architecture-modules.md b/aio/content/guide/architecture-modules.md
index 3780b576ab..4ac64212d7 100644
--- a/aio/content/guide/architecture-modules.md
+++ b/aio/content/guide/architecture-modules.md
@@ -101,9 +101,11 @@ When you create a component, it's associated directly with a single view, called
树中的视图可以嵌套到任意深度。
+
**Note:** The hierarchical structure of views is a key factor in the way Angular detects and responds to changes in the DOM and app data.
**注意:** 视图的这种层次结构是 Angular 在 DOM 和应用数据中检测与响应变更时的关键因素。
+
## NgModules and JavaScript modules
@@ -128,6 +130,7 @@ JavaScript 中,每个*文件*是一个模块,文件中定义的所有对象
+
Learn more about the JavaScript module system on the web.
学习更多关于 JavaScript 模块的知识。
diff --git a/aio/content/guide/build.md b/aio/content/guide/build.md
index 81e53c9472..3e836189c4 100644
--- a/aio/content/guide/build.md
+++ b/aio/content/guide/build.md
@@ -200,12 +200,12 @@ Any option that your build supports can be overridden in a build target configur
To build using the staging configuration, run the following command:
+要想使用预生产环境(staging)的配置进行构建,请运行下列命令:
+
ng build --configuration=staging
-要想使用预生产环境进行构建,请运行 `ng build --configuration=staging`。
-
You can also configure the `serve` command to use the targeted build configuration if you add it to the "serve:configurations" section of `angular.json`:
如果将其添加到 `angular.json` 的 "serve:configurations" 区段,你还可以配置 `serve` 命令来使用 目标构建配置:
diff --git a/aio/content/guide/deployment.md b/aio/content/guide/deployment.md
index 1d7320e78d..1016ded1ea 100644
--- a/aio/content/guide/deployment.md
+++ b/aio/content/guide/deployment.md
@@ -393,12 +393,14 @@ You should measure the app's actual behavior when running in the environments th
你可能花费了大量的时间和金钱来优化一些实际上无关紧要的东西,甚至可能让应用变得更慢。
你应该测量应用在运行环境中的实际行为,这才是最重要的。
+
The
Chrome DevTools Network Performance page is a good place to start learning about measuring performance.
+
-
-Chrome DevTools 的网络和性能页是你开始学习如何测量性能的好地方。
+
+Chrome DevTools 的网络和性能页是你开始学习如何测量性能的好地方。
The [WebPageTest](https://www.webpagetest.org/) tool is another good choice
that can also help verify that your deployment was successful.
diff --git a/aio/content/guide/elements.md b/aio/content/guide/elements.md
index c0eee33c96..e2f73fb706 100644
--- a/aio/content/guide/elements.md
+++ b/aio/content/guide/elements.md
@@ -22,7 +22,7 @@ Transforming a component to a custom element makes all of the required Angular i
Creating a custom element is simple and straightforward, and automatically connects your component-defined view with change detection and data binding, mapping Angular functionality to the corresponding native HTML equivalents.
把组件转换成自定义元素可以让所有所需的 Angular 基础设施都在浏览器中可用。
-创建自定义元素的方式简单直接,并且会自动把你组件定义的视图连同变更检测与数据绑定等 Anuglar 的功能映射为相应的原生 HTML 等价物。
+创建自定义元素的方式简单直接,并且会自动把你组件定义的视图连同变更检测与数据绑定等 Angular 的功能映射为相应的原生 HTML 等价物。
@@ -36,8 +36,6 @@ Creating a custom element is simple and straightforward, and automatically conne
-把组件转换成自定义元素会让所需的 Angular 基础设施也可用在浏览器中。创建自定义元素非常简单直接,它会自动把你的组件视图对接到变更检测和数据绑定机制,会把 Angular 的功能映射到原生 HTML 中的等价物。
-
## Using custom elements
## 使用自定义元素
diff --git a/aio/content/guide/forms-overview.md b/aio/content/guide/forms-overview.md
index 81217a8e03..6d22d1dbbd 100644
--- a/aio/content/guide/forms-overview.md
+++ b/aio/content/guide/forms-overview.md
@@ -521,7 +521,7 @@ Choosing a strategy begins with understanding the strengths and weaknesses of th
## Next steps
-后续步骤
+## 后续步骤
To learn more about reactive forms, see the following guides:
@@ -546,4 +546,7 @@ To learn more about template-driven forms, see the following guides:
* [Template-driven Forms](guide/forms#template-driven-forms)
[模板驱动表单](guide/forms)
+
* [Form Validation](guide/form-validation#template-driven-validation)
+
+ [表单验证](guide/form-validation#template-driven-validation)
\ No newline at end of file
diff --git a/aio/content/guide/glossary.md b/aio/content/guide/glossary.md
index 0f3959174a..c27304d101 100644
--- a/aio/content/guide/glossary.md
+++ b/aio/content/guide/glossary.md
@@ -40,8 +40,6 @@ By compiling your application using the `ngc` command-line tool, you can bootstr
{@a angular-element}
-可以与[即时(JIT)编译](guide/glossary#jit)对比一下。
-
## Angular element
## Angular 元素(element)
@@ -361,9 +359,6 @@ Don't declare the following:
非 Angular 的类和对象,比如:字符串、数字、函数、实体模型、配置、业务逻辑和辅助类
-
- 非 Angular 的类和对象,比如:字符串、数字、函数、实体模型、配置、业务逻辑和辅助类。
-
{@a decorator}
{@a decoration}
@@ -1042,13 +1037,17 @@ When using reactive forms:
构建响应式表单时:
* The "source of truth", the form model, is defined in the component class.
+
+ "权威数据源"(表单模型)定义在组件类中。
+
* Validation is set up through validation functions rather than valdation directives.
- 组件是“权威数据源”。表单验证在组件代码中定义。
+ 表单验证在组件代码而不是验证器指令中定义。
* Each control is explicitly created in the component class by creating a `FormControl` instance manually or with `FormBuilder`.
在组件类中,使用 `new FormControl()` 或者 `FormBuilder` 显性地创建每个控件。
+
* The template input elements do *not* use `ngModel`.
模板中的 `input` 元素**不**使用 `ngModel`。
diff --git a/aio/content/guide/hierarchical-dependency-injection.md b/aio/content/guide/hierarchical-dependency-injection.md
index d42e870b2f..725e55cb61 100644
--- a/aio/content/guide/hierarchical-dependency-injection.md
+++ b/aio/content/guide/hierarchical-dependency-injection.md
@@ -251,7 +251,6 @@ When you configure a provider for a component or directive using the `providers`
* Learn more about [Element Injectors in Angular](https://blog.angularindepth.com/a-curios-case-of-the-host-decorator-and-element-injectors-in-angular-582562abcf0a).
-
欲知详情,参见[Angular 中的元素注入器](https://blog.angularindepth.com/a-curios-case-of-the-host-decorator-and-element-injectors-in-angular-582562abcf0a)。
## Injector bubbling
diff --git a/aio/content/guide/i18n.md b/aio/content/guide/i18n.md
index 442c43c6da..fe56630fe4 100644
--- a/aio/content/guide/i18n.md
+++ b/aio/content/guide/i18n.md
@@ -64,8 +64,6 @@ After you have set up your app to use i18n, the CLI can help you with the follow
为你的应用创建多语言版本。
-本文档集中讲解 [**Angular CLI**](https://cli.angular.io/) 项目,Angular CLI 为它生成了写多语言应用时必须的大部分样板代码。
-
{@a setting-up-locale}
## Setting up the locale of your app
@@ -527,8 +525,6 @@ You can use regular expressions with the `plural` and `select` clauses to provid
### 复数规则
-不同的语言有不同的单复数规则。
-
Suppose that you want to say that something was "updated x minutes ago".
In English, depending upon the number of minutes, you could display "just now", "one minute ago",
or "x minutes ago" (with x being the actual number).
@@ -1233,6 +1229,8 @@ the CLI configuration file, `angular.json`.
The same configuration options can also be provided through the CLI with your existing `production` configuration.
+这些配置项还可以通过 CLI 参数和现有的 `production` 配置来提供。
+
ng build --prod --i18n-file src/locale/messages.fr.xlf --i18n-format xlf --i18n-locale fr
diff --git a/aio/content/guide/npm-packages.md b/aio/content/guide/npm-packages.md
index 609f100f26..1a6516d27f 100644
--- a/aio/content/guide/npm-packages.md
+++ b/aio/content/guide/npm-packages.md
@@ -139,12 +139,12 @@ The following support packages are included as dependencies in the default `pack
新的 Angular 工作空间的 `package.json` 文件中默认包含下列支持包。
Package name | Description
-包名 | 说明
---------------------------------------- | --------------------------------------------------
+包名 | 说明
[**rxjs**](https://github.com/ReactiveX/rxjs) | Many Angular APIs return [_observables_](guide/glossary#observable). RxJS is an implementation of the proposed [Observables specification](https://github.com/tc39/proposal-observable) currently before the [TC39](https://www.ecma-international.org/memento/tc39-m.htm) committee, which determines standards for the JavaScript language.
-[**rxjs**](https://github.com/ReactiveX/rxjs) | 很多 Angular API 都会返回[*可观察对象*](guide/glossary#observable)。RxJS 是对计划中的 [Observable 规范的实现](https://github.com/tc39/proposal-observable) currently before the [TC39](https://www.ecma-international.org/memento/tc39-m.htm) committee, which determines standards for the JavaScript language.
+[**rxjs**](https://github.com/ReactiveX/rxjs) | 很多 Angular API 都会返回[*可观察对象*](guide/glossary#observable)。RxJS 是对计划中的 [Observable 规范的实现](https://github.com/tc39/proposal-observable),它正在等待 [TC39](http://www.ecma-international.org/memento/TC39.htm) 委员会来决定是否将其纳入语言规范。
[**zone.js**](https://github.com/angular/zone.js) | Angular relies on zone.js to run Angular's change detection processes when native JavaScript operations raise events. Zone.js is an implementation of a [specification](https://gist.github.com/mhevery/63fdcdf7c65886051d55) currently before the [TC39](http://www.ecma-international.org/memento/TC39.htm) committee that determines standards for the JavaScript language.
-[**zone.js**](https://github.com/angular/zone.js) | 当原生 JavaScript 操作发生事件时,Angular 要依靠 zone.js 来运行 Angular 的变更检测过程。 Zone.js 是对一个[规范](https://gist.github.com/mhevery/63fdcdf7c65886051d55)的实现,它正在等待 [TC39](http://www.ecma-international.org/memento/TC39.htm) 委员会来决定是否将其纳入语言规范.
+[**zone.js**](https://github.com/angular/zone.js) | 当原生 JavaScript 操作发生事件时,Angular 要依靠 zone.js 来运行 Angular 的变更检测过程。 Zone.js 是对一个[规范](https://gist.github.com/mhevery/63fdcdf7c65886051d55)的实现,它正在等待 [TC39](http://www.ecma-international.org/memento/TC39.htm) 委员会来决定是否将其纳入语言规范。
{@a polyfills}
### Polyfill packages
diff --git a/aio/content/guide/observables.md b/aio/content/guide/observables.md
index 8ce507b928..8d03dd7737 100644
--- a/aio/content/guide/observables.md
+++ b/aio/content/guide/observables.md
@@ -185,6 +185,7 @@ Notice that if you subscribe twice, there will be two separate streams, each emi
+
Multicasting observables take a bit more setup, but they can be useful for certain applications. Later we will look at tools that simplify the process of multicasting, allowing you to take any observable and make it multicasting.
虽然支持多播的可观察对象需要做更多的准备工作,但对某些应用来说,这非常有用。稍后我们会介绍一些简化多播的工具,它们让你能接收任何可观察对象,并把它变成支持多播的。
diff --git a/aio/content/guide/pipes.md b/aio/content/guide/pipes.md
index def87653d5..bb939bbc97 100644
--- a/aio/content/guide/pipes.md
+++ b/aio/content/guide/pipes.md
@@ -579,7 +579,7 @@ display updates as you add heroes, even when you mutate the `heroes` array.
The impure AsyncPipe
-
非纯 AsyncPipe
+
非纯 AsyncPipe
The Angular `AsyncPipe` is an interesting example of an impure pipe.
The `AsyncPipe` accepts a `Promise` or `Observable` as input
diff --git a/aio/content/guide/router.md b/aio/content/guide/router.md
index 65b6104ef9..062dbb2a55 100644
--- a/aio/content/guide/router.md
+++ b/aio/content/guide/router.md
@@ -1302,7 +1302,7 @@ Generate a sample application to follow the walkthrough.
### Define Routes
-#### 定义路由
+### 定义路由
A router must be configured with a list of route definitions.
@@ -1349,6 +1349,8 @@ The first configuration defines an array of two routes with simple paths leading
Replace the contents of each component with the sample HTML below.
+把每个组件的内容都替换成下列范例 HTML。
+
@@ -4251,9 +4253,12 @@ A guard's return value controls the router's behavior:
如果它返回 `true`,导航过程会继续
* If it returns `false`, the navigation process stops and the user stays put.
+
+ 如果它返回 `false`,导航过程就会终止,且用户留在原地。
+
* If it returns a `UrlTree`, the current navigation cancels and a new navigation is initiated to the `UrlTree` returned.
- 如果它返回 `false`,导航过程会终止,且用户会留在原地。
+ 如果它返回 `UrlTree`,则取消当前的导航,并且开始导航到返回的这个 `UrlTree`.
@@ -4660,6 +4665,8 @@ The `AuthGuard` should call an application service that can login a user and ret
Update the `AuthService` to log in the user:
+修改 `AuthService` 以登入此用户:
+
@@ -5099,9 +5106,6 @@ If it doesn't return a valid `Crisis`, return an empty `Observable`, canceling t
-`CrisisService.getCrisis` 方法返回了一个可观察对象,这是为了防止在数据获取完毕前加载路由。
-如果它没有返回一个有效的 `Crisis`,就把用户导航回 `CrisisListComponent`,并取消以前到 `CrisisDetailComponent` 尚未完成的导航。
-
Import this resolver in the `crisis-center-routing.module.ts`
and add a `resolve` object to the `CrisisDetailComponent` route configuration.
diff --git a/aio/content/guide/rx-library.md b/aio/content/guide/rx-library.md
index d2752ff9c7..1b3ecccf1a 100644
--- a/aio/content/guide/rx-library.md
+++ b/aio/content/guide/rx-library.md
@@ -90,6 +90,7 @@ RxJS 提供了很多操作符,不过只有少数是常用的。
下面是一个常用操作符的列表和用法范例,参见 [RxJS API 文档](https://rxjs-dev.firebaseapp.com/api)。
+
Note that, for Angular apps, we prefer combining operators with pipes, rather than chaining. Chaining is used in many RxJS examples.
注意,对于 Angular 应用来说,我们提倡使用管道来组合操作符,而不是使用链式写法。链式写法仍然在很多 RxJS 中使用着。
diff --git a/aio/content/guide/service-worker-getting-started.md b/aio/content/guide/service-worker-getting-started.md
index 6eb966ddeb..b282068d77 100644
--- a/aio/content/guide/service-worker-getting-started.md
+++ b/aio/content/guide/service-worker-getting-started.md
@@ -64,7 +64,7 @@ The above command completes the following actions:
创建一个名叫 [`ngsw-config.json`](/guide/service-worker-config) 的 Service Worker 配置文件,它会用来指定缓存的行为以及其它设定。
- Now, build the project:
+Now, build the project:
现在,构建本项目:
diff --git a/aio/content/guide/testing.md b/aio/content/guide/testing.md
index b479e95fac..50a26d786f 100644
--- a/aio/content/guide/testing.md
+++ b/aio/content/guide/testing.md
@@ -2235,11 +2235,13 @@ you can still fall back to the traditional technique
and pass `it` a function that takes a
[`done` callback](https://jasmine.github.io/2.0/introduction.html#section-Asynchronous_Support).
+虽然 `async` 和 `fakeAsync` 函数极大地简化了 Angular 的异步测试,不过你仍然可以回退到传统的技术中。
+也就是说给 `it` 额外传入一个函数型参数,这个函数接受一个 [`done` 回调](http://jasmine.github.io/2.0/introduction.html#section-Asynchronous_Support)。
+
You can't call `done()` in `async()` or `fakeAsync()` functions, because the `done parameter`
is `undefined`.
-虽然 `async` 和 `fakeAsync` 函数极大地简化了 Angular 的异步测试,不过你仍然可以回退到传统的技术中。
-也就是说给 `it` 额外传入一个函数型参数,这个函数接受一个 [`done` 回调](http://jasmine.github.io/2.0/introduction.html#section-Asynchronous_Support)。
+但你不能在 `async()` 或 `fakeAsync()` 函数中调用 `done()`,因为它的 `done` 参数是 `undefined`。
Now you are responsible for chaining promises, handling errors, and calling `done()` at the appropriate moments.
@@ -4884,6 +4886,7 @@ Here are the most important static methods, in order of likely utility.
+
A few of the `TestBed` instance methods are not covered by static `TestBed` _class_ methods.
These are rarely needed.
diff --git a/aio/content/guide/typescript-configuration.md b/aio/content/guide/typescript-configuration.md
index 1fddc278c0..e9fc6e824e 100644
--- a/aio/content/guide/typescript-configuration.md
+++ b/aio/content/guide/typescript-configuration.md
@@ -205,7 +205,6 @@ QuickStart identifies two *typings*, or `d.ts`, files:
* [node](https://www.npmjs.com/package/@types/node) for code that references objects in the *Node.js®* environment;
-
[node](https://www.npmjs.com/package/@types/node)是为了在 *Node.js®* 环境中引用对象的代码提供的类型定义。
QuickStart doesn't require these typings but many of the samples do.
diff --git a/aio/content/guide/universal.md b/aio/content/guide/universal.md
index c8abfc2677..9ecd2f59b7 100644
--- a/aio/content/guide/universal.md
+++ b/aio/content/guide/universal.md
@@ -44,7 +44,7 @@ Meanwhile, the browser downloads the full client version and switches to it auto
## Why use server-side rendering?
-### 为何需要 Universal
+## 为何需要服务端渲染?
There are three main reasons to create a Universal version of your app.
@@ -73,6 +73,7 @@ There are three main reasons to create a Universal version of your app.
Google, Bing, Facebook, Twitter, and other social media sites rely on web crawlers to index your application content and make that content searchable on the web.
Google、Bing、Facebook、Twitter 和其它社交媒体网站都依赖网络爬虫去索引你的应用内容,并且让它的内容可以通过网络搜索到。
+
These web crawlers may be unable to navigate and index your highly interactive Angular application as a human user could do.
这些网络爬虫可能不会像人类那样导航到你的具有高度交互性的 Angular 应用,并为其建立索引。
@@ -765,10 +766,11 @@ This guide covers them in the sections below.
### Using absolute URLs for server requests
-#### 在 HTTP 中使用绝对地址
+### 在 HTTP 中使用绝对地址
The tutorial's `HeroService` and `HeroSearchService` delegate to the Angular `HttpClient` module to fetch application data.
These services send requests to _relative_ URLs such as `api/heroes`.
+
教程中的 `HeroService` 和 `HeroSearchService` 都委托了 Angular 的 `HttpClient` 模块来获取应用数据。
那些服务都把请求发送到了*相对* URL,比如 `api/heroes`。
@@ -863,7 +865,7 @@ which then forwards it to the client in the HTTP response.
### Filtering request URLs
-#### 过滤请求的 URL
+### 过滤请求的 URL
The web server must distinguish _app page requests_ from other kinds of requests.
@@ -913,6 +915,8 @@ Node Express 服务器是一系列中间件构成的管道,它会挨个对 URL
**Note:** This sample server doesn't handle data requests.
+
+ **注意:**这个范例服务器不会处理数据请求。
The tutorial's "in-memory web API" module, a demo and development tool, intercepts all HTTP calls and
simulates the behavior of a remote data server.
@@ -932,7 +936,7 @@ The following code filters for request URLs with no extensions and treats them a
### Serving static files safely
-#### 安全的提供静态文件
+### 安全的提供静态文件
A single `app.use()` treats all other URLs as requests for static assets
such as JavaScript, image, and style files.
diff --git a/aio/content/tutorial/toh-pt6.md b/aio/content/tutorial/toh-pt6.md
index 996e5e94b3..e65d106705 100644
--- a/aio/content/tutorial/toh-pt6.md
+++ b/aio/content/tutorial/toh-pt6.md
@@ -128,6 +128,8 @@ that primes the in-memory database.
The class `src/app/in-memory-data.service.ts` is generated by the following command:
+`src/app/in-memory-data.service.ts` 类是通过下列命令生成的:
+
ng generate service InMemoryData