fix: minor fix and auto translate based on previous result

This commit is contained in:
Zhicheng Wang 2018-03-18 07:26:14 +08:00
parent ac312e2f9a
commit e0fc873240
25 changed files with 440 additions and 64 deletions

View File

@ -4,12 +4,18 @@ Feature modules are NgModules for the purpose of organizing code.
#### Prerequisites
#### 前提条件
A basic understanding of the following:
对下列知识有基本的了解:
* [Bootstrapping](guide/bootstrapping).
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).
* [Frequently Used Modules](guide/frequent-ngmodules).
For the final sample app with a feature module that this page describes,

View File

@ -2,6 +2,8 @@
#### Prerequisites
#### 前提条件
A basic understanding of [Bootstrapping](guide/bootstrapping).
<hr>
@ -237,3 +239,5 @@ You may also be interested in the following:
* [NgModules](guide/ngmodules).
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).

View File

@ -873,7 +873,7 @@ for each `HttpClient` method call.
To implement an interceptor, declare a class that implements the `intercept()` method of the `HttpInterceptor` interface.
要实现拦截器,就要实现一个实现了 `HttpInterceptor` 接口中的 `intercept()` 方法的类。
要实现拦截器,就要实现一个实现了 `HttpInterceptor` 接口中的 `intercept()` 方法的类。
Here is a do-nothing _noop_ interceptor that simply passes the request through without touching it:

View File

@ -2,12 +2,18 @@
#### Prerequisites
#### 前提条件
A basic understanding of the following:
对下列知识有基本的了解:
* [Feature Modules](guide/feature-modules).
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).
* [Frequently Used Modules](guide/frequent-ngmodules).
* [Types of Feature Modules](guide/module-types).

View File

@ -2,6 +2,8 @@
#### Prerequisites
#### 前提条件
A basic understanding of the following concepts:
对下列概念有基本的理解:
@ -10,6 +12,8 @@ A basic understanding of the following concepts:
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).
* [Frequently Used Modules](guide/frequent-ngmodules).
<hr>

View File

@ -2,6 +2,8 @@
#### Prerequisites
#### 前提条件
A basic understanding of the following concepts:
对下列概念有基本的理解:
@ -10,6 +12,8 @@ A basic understanding of the following concepts:
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).
<hr />
## Purpose of `@NgModule`

View File

@ -2,6 +2,8 @@
#### Prerequisites
#### 前提条件
A basic understanding of [JavaScript/ECMAScript modules](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/).
<hr>

View File

@ -4,6 +4,8 @@
#### Prerequisites
#### 前提条件
A basic understanding of the following concepts:
对下列概念有基本的理解:
@ -12,6 +14,8 @@ A basic understanding of the following concepts:
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).
<hr>
**NgModules** configure the injector and the compiler and help organize related things together.

View File

@ -998,8 +998,8 @@ such as one of the following:
`true` if the control user has not yet entered the HTML control
and triggered its blur event. Its opposite is `myControl.touched`.
如果用户尚未进入这个HTML控件也没有触发过它的`blur`(失去焦点)事件,则为`true`。
如果用户尚未进入这个HTML控件也没有触发过它的`blur`(失去焦点)事件,则为`true`。
它是`myControl.touched`的反义词。
</td>

View File

@ -4,8 +4,12 @@ Importing `ServiceWorkerModule` into your `AppModule` doesn't just register the
#### Prerequisites
#### 前提条件
A basic understanding of the following:
对下列知识有基本的了解:
* [Getting Started with Service Workers](guide/service-worker-getting-started).
<hr />

View File

@ -4,8 +4,12 @@
#### Prerequisites
#### 前提条件
A basic understanding of the following:
对下列知识有基本的了解:
* [Service Worker in Production](guide/service-worker-devops).
<hr />

View File

@ -4,8 +4,12 @@ This page is a reference for deploying and supporting production apps that use t
#### Prerequisites
#### 前提条件
A basic understanding of the following:
对下列知识有基本的了解:
* [Service Worker Communication](guide/service-worker-communications).
<hr />

View File

@ -2,8 +2,12 @@
#### Prerequisites
#### 前提条件
A basic understanding of the following:
对下列知识有基本的了解:
* [Introduction to Angular service workers](guide/service-worker-intro).
<hr />

View File

@ -2,12 +2,18 @@
#### Prerequisites
#### 前提条件
A basic understanding of the following:
对下列知识有基本的了解:
* [Feature Modules](guide/feature-modules).
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).
* [Frequently Used Modules](guide/frequent-ngmodules).
* [Routing and Navigation](guide/router).

View File

@ -676,6 +676,8 @@ and reference assets of different types.
<a href="#toc">Back to top</a>
<a href="#toc">回到顶部</a>
{@a 02-04}
### Service names
@ -1061,6 +1063,8 @@ For example, the prefix `toh` represents from **T**our **o**f **H**eroes and the
<a href="#toc">Back to top</a>
<a href="#toc">回到顶部</a>
{@a 02-09}
### Pipe names
@ -1915,6 +1919,8 @@ discourage the `I` prefix.
<a href="#toc">Back to top</a>
<a href="#toc">回到顶部</a>
{@a 03-06}
### Import line spacing
@ -2003,6 +2009,8 @@ Use the naming conventions for files in this guide.
<a href="#toc">Back to top</a>
<a href="#toc">回到顶部</a>
{@a 04-01}
### _LIFT_
@ -2079,6 +2087,8 @@ A descriptive folder structure makes a world of difference to you and the people
<a href="#toc">Back to top</a>
<a href="#toc">回到顶部</a>
{@a 04-03}
### Identify
@ -2198,6 +2208,8 @@ Use a flatter structure until there is an obvious value to creating a new folder
<a href="#toc">Back to top</a>
<a href="#toc">回到顶部</a>
{@a 04-05}
### _T-DRY_ (Try to be _DRY_)
@ -3904,6 +3916,8 @@ and the directive name doesn't describe the property.
<a href="#toc">Back to top</a>
<a href="#toc">回到顶部</a>
{@a 05-14}
### Member sequence
@ -4085,6 +4099,8 @@ helps instantly identify which members of the component serve which purpose.
<a href="#toc">Back to top</a>
<a href="#toc">回到顶部</a>
{@a 05-17}
### Put presentation logic in the component class
@ -4179,6 +4195,8 @@ helps instantly identify which members of the component serve which purpose.
<a href="#toc">Back to top</a>
<a href="#toc">回到顶部</a>
{@a 06-03}
### _HostListener_/_HostBinding_ decorators versus _host_ metadata

View File

@ -2046,8 +2046,6 @@ This section is an introduction to the most commonly used attribute directives:
### NgClass
### NgClass 指令
You typically control how elements appear
by adding and removing CSS classes dynamically.
You can bind to the `ngClass` to add or remove several classes simultaneously.
@ -2105,8 +2103,6 @@ It's up to you to call `setCurrentClasses()`, both initially and when the depend
### NgStyle
### NgStyle 指令
You can set inline styles dynamically, based on the state of the component.
With `NgStyle` you can set many inline styles simultaneously.
@ -2362,8 +2358,6 @@ _This_ section is an introduction to the common structural directives:
### NgIf
### NgIf 指令
You can add or remove an element from the DOM by applying an `NgIf` directive to
that element (called the _host element_).
Bind the directive to a condition expression like `isActive` in this example.
@ -2468,8 +2462,6 @@ described below.
### NgForOf
### NgFor 指令
`NgForOf` is a _repeater_ directive &mdash; a way to present a list of items.
You define a block of HTML that defines how a single item should be displayed.
You tell Angular to use that block as a template for rendering each item in the list.
@ -3017,7 +3009,7 @@ That _other way_ is the `@Input()` and `@Output()` decorators.
In the sample for this guide, the bindings to `HeroDetailComponent` do not fail
because the data bound properties are annotated with `@Input()` and `@Output()` decorators.
在本章的例子中,绑定到 `HeroDetailComponent` 不会失败,这是因为这些要进行数据绑定的属性都带有 `@Input()``@Output()` 装饰器。
在本章的例子中,绑定到 `HeroDetailComponent` 不会失败,这是因为这些要进行数据绑定的属性都带有 `@Input()``@Output()` 装饰器。
<code-example path="template-syntax/src/app/hero-detail.component.ts" region="input-output-1" title="src/app/hero-detail.component.ts" linenums="false">

View File

@ -2734,7 +2734,7 @@ Rely on your intuition for now.
When the `id` cannot be found, the component should re-route to the `HeroListComponent`.
当找不到 `id` 的时候,组件应该重新路由到 `HeroListComponent`
当找不到 `id` 的时候,组件应该重新路由到 `HeroListComponent`
The test suite setup provided the same router spy [described above](#routing-component) which spies on the router without actually navigating.
@ -2963,7 +2963,7 @@ The Angular compiler creates the `BannerComponentStub` for the `<app-banner>` el
and applies the `RouterLinkStubDirective` to the anchors with the `routerLink` attribute,
but it ignores the `<app-welcome>` and `<router-outlet>` tags.
Angular 编译器会为 `<app-banner>` 元素创建 `BannerComponentStub`,并把 `RouterLinkStubDirective` 应用到带有 `routerLink` 属性的链接上,不过它会忽略 `<app-welcome>``<router-outlet>` 标签。
Angular 编译器会为 `<app-banner>` 元素创建 `BannerComponentStub`,并把 `RouterLinkStubDirective` 应用到带有 `routerLink` 属性的链接上,不过它会忽略 `<app-welcome>``<router-outlet>` 标签。
<hr>
@ -3052,7 +3052,7 @@ Three points of special interest:
1. Each `DebugElement` exposes a dependency injector with the
specific instance of the directive attached to that element.
每个 `DebugElement` 都会导出该元素中的一个依赖注入器,其中带有指定的指令实例。
The `AppComponent` links to validate are as follows:
@ -4505,7 +4505,7 @@ Here are the most important static methods, in order of likely utility.
`inject` 函数通常都能胜任这项工作,但是如果它没法提供该服务时就会抛出一个异常。
What if the service is optional?
如果该服务是可选的呢?
The `TestBed.get()` method takes an optional second parameter,

View File

@ -217,10 +217,11 @@ QuickStart doesn't require these typings but many of the samples do.
{@a target}
### *target*
### *编译目标target*
By default, the target is `es5`, you can configure the target to `es6` if you only want to deploy the application to
es6 compatible browser. But if you configure the target to `es6` in some old browser such as `IE`, `Syntax Error` will be thrown.
默认情况下,编译目标是 `es5`,如果你只想发布到兼容 es6 的浏览器中,也可以把它配置为 `es6`
不过,如果配置为 `es6`,那么一些老的浏览器(如 `IE` )中就会抛出 `Syntax Error` 错误。
不过,如果配置为 `es6`,那么一些老的浏览器(如 `IE` )中就会抛出 `Syntax Error` 错误。

View File

@ -7,31 +7,56 @@ Angular is a platform that makes it easy to build applications with the web. Ang
Angular 是一个开发平台。它能帮你更轻松的构建 Web 应用。Angular 集声明式模板、依赖注入、端到端工具和一些最佳实践于一身为你解决开发方面的各种挑战。Angular 为开发者提升构建 Web、手机或桌面应用的能力。
<div class="card-container">
<a href="generated/live-examples/toh-pt1/stackblitz.html" target="_blank" class="docs-card"
title="Experience Angular in a live coding environment">
<section>Get a Glimpse of Angular</section>
<section>Angular 走马观花</section>
<p>A quick look at an Angular "hello world" application.</p>
<p>快速体验 Angular 的 "hello world" 应用。</p>
<p class="card-footer">Angular in Action</p>
<p class="card-footer">体验 Angular</p>
</a>
<a href="guide/quickstart" class="docs-card" title="Angular Quickstart">
<section>Get Going with Angular</section>
<section>开始使用 Angular</section>
<p>Get going on your own environment with the Quickstart.</p>
<p>跟随"快速上手"构建你的开发环境</p>
<p class="card-footer">Quickstart</p>
<p class="card-footer">快速上手</p>
</a>
<a href="guide/architecture" class="docs-card" title="Angular Architecture">
<section>Fundamentals</section>
<section>基本原理</section>
<p>Learn Angular application fundamentals, starting with an architecture overview.</p>
<p>学习 Angular 应用的基本原理。<br/>从架构概览开始。</p>
<p class="card-footer">Architecture</p>
<p class="card-footer">架构</p>
</a>
</div>
## Assumptions

View File

@ -7,7 +7,7 @@
## 安装 Angular CLI 命令行工具
Install the [Angular CLI](https://github.com/angular/angular-cli), if you haven't already done so.
如果还没有安装 [Angular CLI](https://github.com/angular/angular-cli),请执行:
<code-example language="sh" class="code-shell">
@ -100,11 +100,11 @@ You'll find the implementation of the shell `AppComponent` distributed over thre
1. `app.component.html`&mdash; the component template, written in HTML.
`app.component.html`&mdash; 组件的模板,这是用 HTML 写的。
`app.component.html`&mdash; 组件的模板,这是用 HTML 写的。
1. `app.component.css`&mdash; the component's private CSS styles.
`app.component.ts`&mdash; 组件的私有 CSS 样式。
`app.component.ts`&mdash; 组件的私有 CSS 样式。
Open the component class file (`app.component.ts`) and change the value of the `title` property to 'Tour of Heroes'.
@ -198,6 +198,6 @@ Here are the code files discussed on this page.
你学会了使用 Angular 组件来显示数据。
* You used the double curly braces of interpolation to display the app title.
* You used the double curly braces of interpolation to display the app title.
你使用双花括号插值表达式显示了应用标题。

View File

@ -74,7 +74,7 @@ The `ngOnInit` is a [lifecycle hook](guide/lifecycle-hooks#oninit)
Angular calls `ngOnInit` shortly after creating a component.
It's a good place to put initialization logic.
`ngOnInit` 是一个[生命周期钩子](guide/lifecycle-hooks#oninit)Angular 在创建完组件后很快就会调用 `ngOnInit`。这里是放置初始化逻辑的好地方。
`ngOnInit` 是一个[生命周期钩子](guide/lifecycle-hooks#oninit)Angular 在创建完组件后很快就会调用 `ngOnInit`。这里是放置初始化逻辑的好地方。
Always `export` the component class so you can `import` it elsewhere ... like in the `AppModule`.

View File

@ -197,7 +197,7 @@ the hero detail appears below the hero list.
Now the `HeroDetailComponent` is presenting those details instead of the `HeroesComponent`.
像[以前](tutorial/toh-pt2)一样,一旦用户点击了一个英雄的名字,该英雄的详情就显示在了英雄列表下方。
现在,`HeroDetailComponent` 负责显示那些详情,而不再是 `HeroesComponent`
现在,`HeroDetailComponent` 负责显示那些详情,而不再是 `HeroesComponent`
Refactoring the original `HeroesComponent` into two components yields benefits, both now and in the future:

View File

@ -173,7 +173,7 @@ configure it with the `routes` in one step by calling
## Add _RouterOutlet_
## 添加路由出口 _RouterOutlet_
## 添加路由出口 _RouterOutlet_
Open the `AppComponent` template replace the `<app-heroes>` element with a `<router-outlet>` element.
@ -204,7 +204,7 @@ because `AppModule` imports `AppRoutingModule` which exported `RouterModule`.
#### Try it
#### 试试
#### 试试
You should still be running with this CLI command.
@ -791,7 +791,7 @@ without having to change the `HeroDetailComponent` that calls it.
#### Try it
#### 试试
#### 试试
The browser refreshes and the app is working again.
You can click a hero in the dashboard or in the heroes list and navigate to that hero's detail view.

View File

@ -1,7 +1,5 @@
# HTTP
# HTTP 服务
In this tutorial, you'll add the following data persistence features with help from
Angular's `HttpClient`.
@ -611,7 +609,7 @@ anticipating that the `HeroService` will succeed on the server.
There's really nothing for the component to do with the `Observable` returned by
`heroService.delete()`. **It must subscribe anyway**.
组件与 `heroService.delete()` 返回的 `Observable` 还完全没有关联。**必须订阅它**。
组件与 `heroService.delete()` 返回的 `Observable` 还完全没有关联。**必须订阅它**。
<div class="alert is-important">
@ -910,7 +908,7 @@ It cancels and discards previous search observables, returning only the latest s
`switchMap()` preserves the original request order while returning only the observable from the most recent HTTP method call.
Results from prior calls are canceled and discarded.
`switchMap()` 会记住原始的请求顺序,只会返回最近一次 HTTP 方法调用的结果。
以前的那些请求都会被取消和舍弃。

View File

@ -3151,7 +3151,7 @@
},
{
"original": "The npm packages for the _mandatory_ polyfills (such as `zone.js`) were installed automatically for you when you created your project and their corresponding `import` statements are ready to go. You probably won't touch these.",
"translation": "**强制性** 腻子脚本(如`zone.js`的npm 包在创建工程时就已经自动安装了,相应的 `import` 语句也都加好了。我们一般不用动它们。",
"translation": "**强制性** 腻子脚本(如`zone.js`的npm 包在创建项目时就已经自动安装了,相应的 `import` 语句也都加好了。我们一般不用动它们。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/browser-support.md"
},
{
@ -3396,7 +3396,7 @@
},
{
"original": "All samples now have a `src/` folder at the project root.\nThe former `app/` folder moves under `src/`.\nRead about moving your existing project to this structure in\n<a href=\"https://github.com/angular/quickstart#updating-to-a-newer-version-of-the-quickstart-repo\" target=\"Migrating samples/quickstart app to the src folder\">\nthe QuickStart repo update instructions</a>.",
"translation": "我们已经把所有范例改成了使用项目根目录下的`src/`文件夹。\n也就是把以前的`app/`文件夹移到了`src/`文件夹下面。\n要了解如何对你的现有工程进行这种迁移,请参阅<a href=\"https://github.com/angular/quickstart#updating-to-a-newer-version-of-the-quickstart-repo\" target=\"_blank\" target=\"把范例中的应用迁移到src文件夹\">QuickStart中的迁移指南</a>。",
"translation": "我们已经把所有范例改成了使用项目根目录下的`src/`文件夹。\n也就是把以前的`app/`文件夹移到了`src/`文件夹下面。\n要了解如何对你的现有项目进行这种迁移,请参阅<a href=\"https://github.com/angular/quickstart#updating-to-a-newer-version-of-the-quickstart-repo\" target=\"_blank\" target=\"把范例中的应用迁移到src文件夹\">QuickStart中的迁移指南</a>。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/change-log.md"
},
{
@ -7184,6 +7184,21 @@
"translation": "## 为生产环境优化",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "Although deploying directly from the development environment works, \nyou can generate an optimized build with additional CLI command line flags,\nstarting with `--prod`.",
"translation": "虽然也可以直接用开发环境的设置进行部署,不过你也可以使用 CLI 命令的其它标志生成一个优化过的构建成果。\n先来看 `--prod`。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "### Build with _--prod_",
"translation": "### 使用 `--prod` 构建。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "The `--prod` _meta-flag_ engages the following optimization features.",
"translation": "`--prod` *元标志*包括下列优化特性。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "* [Ahead-of-Time (AOT) Compilation](guide/aot-compiler): pre-compiles Angular component templates.",
"translation": "[预(AOT)编译](guide/aot-compiler):预编译 Angular 组件的模板。",
@ -7219,6 +7234,16 @@
"translation": "剩下的 [拷贝部署步骤](#copy-files) 和以前的方式是一样的。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "You may further reduce bundle sizes by adding the `build-optimizer` flag.",
"translation": "你还可以添加 `build-optimizer` 标志来进一步缩减打包体积。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "See the [CLI Documentation](https://github.com/angular/angular-cli/wiki/build) \nfor details about available build options and what they do.",
"translation": "参见 [CLI 文档](https://github.com/angular/angular-cli/wiki/build),来了解可用的构建选项及其用途的详细信息。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "### Enable production mode",
"translation": "### 启用生产模式",
@ -7234,6 +7259,11 @@
"translation": "切换到生产模式可以通过禁用开发环境下特有的检查(比如双重变更检测周期)来让应用运行得更快。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "Building for production (or appending the `--environment=prod` flag) enables _production mode_\nLook at the CLI-generated `main.ts` to see how this works.",
"translation": "为生产环境构建(或添加 `--environment=prod` 标志)可以启用*生产模式*。\n查看 CLI 自动生成的 `main.ts` 文件来了解它的工作原理。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "### Lazy loading",
"translation": "### 惰性加载",
@ -7264,6 +7294,16 @@
"translation": "关于打包bundle方式的配置必须考虑到惰性加载问题。\n因为惰性加载模块不能在JavaScript中导入就像刚才说明的打包器应该默认排除它们。\n打包器不知道路由器的配置并且不会为延迟加载模块创建单独的包。\n我们不得不手动创建这些包。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "The CLI runs the\n[Angular Ahead-of-Time Webpack Plugin](https://github.com/angular/angular-cli/tree/master/packages/%40ngtools/webpack)\nwhich automatically recognizes lazy loaded `NgModules` and creates separate bundles for them.",
"translation": "CLI 会运行 [Angular AOT 编译 Webpack 插件](https://github.com/angular/angular-cli/tree/master/packages/%40ngtools/webpack),它会自动识别出那些需要惰性加载的 `NgModule`,并为它们创建单独的文件包。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "### Measure performance",
"translation": "### 性能测量",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "You can make better decisions about what to optimize and how when you have a clear and accurate understanding of\nwhat's making the application slow.\nThe cause may not be what you think it is.\nYou can waste a lot of time and money optimizing something that has no tangible benefit or even makes the app slower.\nYou should measure the app's actual behavior when running in the environments that are important to you.",
"translation": "如果我们能对“是什么导致了应用变慢”的问题有一个清晰、准确的理解,那就可以对优化什么、如何优化做出更好地决策了。\n真正的原因可能并不是你所想的那样。\n我们可能花费大量的时间和金钱去优化一些东西但它却无法产生可感知的效果甚至让应用变得更慢。\n我们应该在那些最重要的环境中实际运行来度量应用的实际行为。",
@ -7271,7 +7311,7 @@
},
{
"original": "The\n<a href=\"https://developers.google.com/web/tools/chrome-devtools/network-performance/understanding-resource-timing\" title=\"Chrome DevTools Network Performance\">\nChrome DevTools Network Performance page</a> is a good place to start learning about measuring performance.",
"translation": "<a href=\"https://developers.google.com/web/tools/chrome-devtools/network-performance/understanding-resource-timing\" target=\"_blank\" title=\"Chrome DevTools Network Performance\">\n Chrome开发工具的网络性能页</a>是开始学习度量性能的好地方。",
"translation": "<p><a href=\"https://developers.google.com/web/tools/chrome-devtools/network-performance/understanding-resource-timing\" target=\"_blank\" title=\"Chrome DevTools Network Performance\">\n Chrome开发工具的网络性能页</a>是开始学习度量性能的好地方。</p>",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
@ -7279,6 +7319,51 @@
"translation": "[WebPageTest](https://www.webpagetest.org/)工具是另一个不错的选择,它能帮你验证你的部署是否成功了。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "### Inspect the bundles",
"translation": "### 深入探查文件包bundle",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "The <a href=\"https://github.com/danvk/source-map-explorer/blob/master/README.md\">source-map-explorer</a>\ntool is a great way to inspect the generated JavaScript bundles after a production build.",
"translation": "<a href=\"https://github.com/danvk/source-map-explorer/blob/master/README.md\">source-map-explorer</a> 是在生产环境构建中深入探查所生成的文件包的好工具。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "Install `source-map-explorer`:",
"translation": "安装 `source-map-explorer`",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "Build your app for production _including the source maps_",
"translation": "构建*带源码映射*的生产版本",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "List the generated bundles in the `dist/` folder.",
"translation": "列出 `dist/` 文件夹中生成的文件包。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "Run the explorer to generate a graphical representation of one of the bundles.\nThe following example displays the graph for the _main_ bundle.",
"translation": "运行这个源码映射浏览器,以生成文件包之一的图形化表示。\n下面的例子中就是 `main` 这个文件包的图形。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "The `source-map-explorer` analyzes the source map generated with the bundle and draws a map of all dependencies,\nshowing exactly which classes are included in the bundle.",
"translation": "`source-map-explorer` 分析了文件包生成的源码映射信息,并画出了所有这些依赖的地图,准确的展示了这个包中包含了哪些类。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "Here's the output for the _main_ bundle of the QuickStart.",
"translation": "下面是《快速起步》一章生成的 `main` 文件包的输出。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "## The `base` tag",
"translation": "## `base` 标签",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "The HTML [_&lt;base href=\"...\"/&gt;_](/guide/router)\nspecifies a base path for resolving relative URLs to assets such as images, scripts, and style sheets.\nFor example, given the `<base href=\"/my/app/\">`, the browser resolves a URL such as `some/place/foo.jpg`\ninto a server request for `my/app/some/place/foo.jpg`.\nDuring navigation, the Angular router uses the _base href_ as the base path to component, template, and module files.",
"translation": "HTML中的[_&lt;base href=\"...\"/&gt;_](https://angular.io/docs/ts/latest/guide/router.html#!)用于指定一个解析相对路径的基地址,如图片、脚本和样式表。\n比如指定`<base href=\"/my/app/\">`时,浏览器就会把`some/place/foo.jpg`这样的URL解析成到`my/app/some/place/foo.jpg`的服务端请求。\n在浏览期间Angular路由器会使用*base href*作为组件、模板和模块文件的基地址。",
@ -7299,6 +7384,51 @@
"translation": "但是在共享服务器或生产服务器上,我们可能得从子目录下启动服务器。\n比如当加载本应用的URL是`http://www.mysite.com/my/app/`时,子目录就是`my/app/`,而我们就要在服务器版的`index.html`中添加`<base href=\"/my/app/\">`。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "When the `base` tag is mis-configured, the app fails to load and the browser console displays `404 - Not Found` errors\nfor the missing files. Look at where it _tried_ to find those files and adjust the base tag appropriately.",
"translation": "当没有配置 `base` 标签时,加载应用就会失败,浏览器的控制台中会为这些缺失的文件显示一些 `404 - Not Found` 错误。\n看看浏览器*试图*从哪里找这些文件,然后调整出合适的 base 标签。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "## _build_ vs. _serve_",
"translation": "## *构建*与*服务*",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "You'll probably prefer `ng build` for deployments.",
"translation": "你会更喜欢用 `ng build` 进行部署。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "The **ng build** command is intended for building the app and deploying the build artifacts elsewhere.\nThe **ng serve** command is intended for fast, local, iterative development.",
"translation": "**ng build** 命令的设计意图是构建该应用,并且把构建成果部署到别处。\n而**ng serve** 命令的设计意图是快速进行本地的迭代式开发。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "Both `ng build` and `ng serve` **clear the output folder** before they build the project.\nThe `ng build` command writes generated build artifacts to the output folder.\nThe `ng serve` command does not.\nIt serves build artifacts from memory instead for a faster development experience.",
"translation": "在开始构建项目之前,`ng build` 和 `ng serve` **都会清空输出文件夹**。\n`ng build` 命令会把生成的构建成果写入输出文件夹中,但 `ng serve` 命令并不会如此。\n它会用内存中的构建成果提供服务以获得更快速的开发体验。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "The output folder is `dist/` by default.\nTo output to a different folder, change the `outDir` in `.angular-cli.json`.",
"translation": "默认的输出文件夹是 `dist/`。\n要输出到其它文件夹中请修改 `.angular-cli.json` 中的 `outDir`。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "The `ng serve` command builds, watches, and serves the application from a local CLI development server.",
"translation": "`ng serve` 命令会构建、监听并使用本地的 CLI 开发服务器作为服务器。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "The `ng build` command generates output files just once and does not serve them.\nThe `ng build --watch` command will regenerate output files when source files change.\nThis `--watch` flag is useful if you're building during development and \nare automatically re-deploying changes to another server.",
"translation": "`ng build` 命令只会生成一次这些输出文件,而不会用它们提供服务。\n`ng build --watch` 命令会在源码变化的时候重新生成输出文件。\n当你在开发期间需要不断构建并自动把修改后的版本发布到另一台服务器的时候这个 `--watch` 标志会很有用。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "See the [CLI `build` topic](https://github.com/angular/angular-cli/wiki/build) for more details and options.",
"translation": "参见 [CLI 中的 `build` 主题](https://github.com/angular/angular-cli/wiki/build)以了解详情以及其它选项。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/deployment.md"
},
{
"original": "## Server configuration",
"translation": "## 服务端配置",
@ -8194,6 +8324,21 @@
"translation": "对下列概念有基本的理解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/entry-components.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/feature-modules.md"
},
{
"original": "A basic understanding of the following:",
"translation": "对下列知识有基本的了解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/feature-modules.md"
},
{
"original": "* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).",
"translation": "[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/feature-modules.md"
},
{
"original": "# Form Validation",
"translation": "# 表单验证",
@ -9409,11 +9554,21 @@
"translation": "下面是该应用最终版本的代码:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/forms.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/frequent-ngmodules.md"
},
{
"original": "<code>RouterModule</code>",
"translation": "<code>RouterModule</code>(路由器模块)",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/frequent-ngmodules.md"
},
{
"original": "* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).",
"translation": "[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/frequent-ngmodules.md"
},
{
"original": "# Angular Glossary",
"translation": "# Angular 词汇表",
@ -12486,17 +12641,17 @@
},
{
"original": "## Installing in your project",
"translation": "## 安装到工程中",
"translation": "## 安装到项目中",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/language-service.md"
},
{
"original": "You can also install Angular Language Service in your project with the \nfollowing `npm` command:",
"translation": "我们还可以使用下列`npm`命令来把 Angular 语言服务安装到工程中:",
"translation": "我们还可以使用下列`npm`命令来把 Angular 语言服务安装到项目中:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/language-service.md"
},
{
"original": "Additionally, add the following to the `\"compilerOptions\"` section of \nyour project's `tsconfig.json`.",
"translation": "另外,还要在工程的`tsconfig.json`中添加下列`\"compilerOptions\"`区域:",
"translation": "另外,还要在项目的`tsconfig.json`中添加下列`\"compilerOptions\"`区域:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/language-service.md"
},
{
@ -12511,7 +12666,7 @@
},
{
"original": "When you use an editor with a language service, there's an \neditor process which starts a separate language process/service \nto which it speaks through an [RPC](https://en.wikipedia.org/wiki/Remote_procedure_call). \nAny time you type inside of the editor, it sends information to the other process to \ntrack the state of your project. When you trigger a completion list within a template, the editor process first parses the template into an HTML AST, or [abstract syntax tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree). Then the Angular compiler interprets \nwhat module the template is part of, the scope you're in, and the component selector. Then it figures out where in the template AST your cursor is. When it determines the \ncontext, it can then determine what the children can be.",
"translation": "当使用带有语言服务的编辑器时,就会有一个编辑器进程,它会启动一个独立的语言服务进程/服务,它们通过[RPC](https://en.wikipedia.org/wiki/Remote_procedure_call)彼此交谈。\n当我们在编辑器中输入的时候它把这些信息发送到另一个进程中以便追踪工程的状态。\n当我们在模板中触发一个自动完成列表时编辑器进程就会先把这个模板解析成 HTML AST或者叫[抽象语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree)。然后Angular 编译器就会解释模板所属的模块以及模板选择器。然后它找出我们的光标目前正在模板 AST 的什么位置。一旦它确定了情境,就可以决定其子节点可以是什么了。",
"translation": "当使用带有语言服务的编辑器时,就会有一个编辑器进程,它会启动一个独立的语言服务进程/服务,它们通过[RPC](https://en.wikipedia.org/wiki/Remote_procedure_call)彼此交谈。\n当我们在编辑器中输入的时候它把这些信息发送到另一个进程中以便追踪项目的状态。\n当我们在模板中触发一个自动完成列表时编辑器进程就会先把这个模板解析成 HTML AST或者叫[抽象语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree)。然后Angular 编译器就会解释模板所属的模块以及模板选择器。然后它找出我们的光标目前正在模板 AST 的什么位置。一旦它确定了情境,就可以决定其子节点可以是什么了。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/language-service.md"
},
{
@ -12534,6 +12689,21 @@
"translation": "要了解更多信息,参见 [ng-conf](https://www.ng-conf.org/) 2017 中 [Chuck Jazdzewski的演讲](https://www.youtube.com/watch?v=ez3R0Gi4z5A&t=368s) 中讲解的 Angular 语言服务。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/language-service.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/lazy-loading-ngmodules.md"
},
{
"original": "A basic understanding of the following:",
"translation": "对下列知识有基本的了解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/lazy-loading-ngmodules.md"
},
{
"original": "* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).",
"translation": "[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/lazy-loading-ngmodules.md"
},
{
"original": "# Lifecycle Hooks",
"translation": "# 生命周期钩子",
@ -13199,11 +13369,21 @@
"translation": "回忆一下Angular在每次调用*AfterView*钩子之前也会同时调用*AfterContent*。\nAngular在完成当前组件的视图合成之前就已经完成了被投影内容的合成。\n所以我们仍然有机会去修改那个视图。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/lifecycle-hooks.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/module-types.md"
},
{
"original": "A basic understanding of the following concepts:",
"translation": "对下列概念有基本的理解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/module-types.md"
},
{
"original": "* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).",
"translation": "[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/module-types.md"
},
{
"original": "Feature Module",
"translation": "特性模块",
@ -13374,11 +13554,21 @@
"translation": "特性",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/module-types.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/ngmodule-api.md"
},
{
"original": "A basic understanding of the following concepts:",
"translation": "对下列概念有基本的理解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/ngmodule-api.md"
},
{
"original": "* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).",
"translation": "[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/ngmodule-api.md"
},
{
"original": "The following table summarizes the `@NgModule` metadata properties.",
"translation": "下面是`@NgModule`元数据中属性的汇总表:",
@ -14344,6 +14534,11 @@
"translation": "`@NgModule`元数据告诉*Angular编译器*要为当前模块编译哪些组件,以及如何把当前模块和其它模块链接起来。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/ngmodule-faq.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/ngmodule-vs-jsmodule.md"
},
{
"original": "* An NgModule bounds [declarable classes](guide/ngmodule-faq#q-declarable) only.\nDeclarables are the only classes that matter to the [Angular compiler](guide/ngmodule-faq#q-angular-compiler).",
"translation": "Angular模块只绑定了[_可声明的类_](guide/ngmodule-faq#q-declarable),这些可声明的类只是供[Angular编译器](guide/ngmodule-faq#q-angular-compiler)用的。",
@ -14359,11 +14554,21 @@
"translation": "# Angular模块 (NgModule)",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/ngmodules.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/ngmodules.md"
},
{
"original": "A basic understanding of the following concepts:",
"translation": "对下列概念有基本的理解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/ngmodules.md"
},
{
"original": "* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).",
"translation": "[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/ngmodules.md"
},
{
"original": "## Angular modularity",
"translation": "## Angular 模块化",
@ -21139,6 +21344,46 @@
"translation": "Angular应用应该遵循和常规Web应用一样的安全原则并按照这些原则进行审计。Angular中某些应该在安全评审中被审计的API\n比如[_bypassSecurityTrust_](guide/security#bypass-security-apis) API都在文档中被明确标记为安全性敏感的。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/security.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/service-worker-communications.md"
},
{
"original": "A basic understanding of the following:",
"translation": "对下列知识有基本的了解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/service-worker-communications.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/service-worker-config.md"
},
{
"original": "A basic understanding of the following:",
"translation": "对下列知识有基本的了解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/service-worker-config.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/service-worker-devops.md"
},
{
"original": "A basic understanding of the following:",
"translation": "对下列知识有基本的了解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/service-worker-devops.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/service-worker-getting-started.md"
},
{
"original": "A basic understanding of the following:",
"translation": "对下列知识有基本的了解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/service-worker-getting-started.md"
},
{
"original": "# Set the Document Title",
"translation": "# 设置文档标题",
@ -21629,6 +21874,21 @@
"translation": "在 Windows 中,默认情况下一个应用只能有六个 WebSocket 连接,参见 <a href=\"https://msdn.microsoft.com/library/ee330736%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396#websocket_maxconn\" title=\"MSDN WebSocket settings\">MSDN 中的 WebSocket 设置部分</a>。\n所以如果 IE 手动刷新或被 `ng serve` 触发了自动刷新,有时候 WebSocket 可能无法正常关闭,当 WebSocket 的连接数超限时,就会抛出 `SecurityError` 异常。请放心,这个异常对 Angular 应用没什么影响,你重启一下 IE 就能消除这个错误,或者修改 Windows 注册表来修改这个上限。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/setup.md"
},
{
"original": "#### Prerequisites",
"translation": "#### 前提条件",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/sharing-ngmodules.md"
},
{
"original": "A basic understanding of the following:",
"translation": "对下列知识有基本的了解:",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/sharing-ngmodules.md"
},
{
"original": "* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).",
"translation": "[JavaScript 模块与 NgModules](guide/ngmodule-vs-jsmodule).",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/sharing-ngmodules.md"
},
{
"original": "Note the following:",
"translation": "请注意以下几点:",
@ -22694,6 +22954,11 @@
"translation": "文件名",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "<a href=\"#toc\">Back to top</a>",
"translation": "<a href=\"#toc\">回到顶部</a>",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "### Service names",
"translation": "### 服务名",
@ -22889,6 +23154,11 @@
"translation": "**为何?**指令更加容易被识别。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "<a href=\"#toc\">Back to top</a>",
"translation": "<a href=\"#toc\">回到顶部</a>",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "### Pipe names",
"translation": "### 管道名",
@ -23284,6 +23554,11 @@
"translation": "**为何?** TypeScript 工具让识别私有或公有属性和方法变得很简单。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "<a href=\"#toc\">Back to top</a>",
"translation": "<a href=\"#toc\">回到顶部</a>",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "### Import line spacing",
"translation": "### 导入语句中的空行",
@ -23344,6 +23619,11 @@
"translation": "所有内容都遵循每个文件一个特性的原则。每个组件、服务和管道都在自己的文件里。\n所有第三方程序包保存到其它目录里而不是`src`目录。\n你不会修改它们所以不希望它们弄乱我们的应用程序。\n使用本指南介绍的文件命名约定。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "<a href=\"#toc\">Back to top</a>",
"translation": "<a href=\"#toc\">回到顶部</a>",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "#### Style 04-01",
"translation": "#### 风格 04-01",
@ -23389,6 +23669,11 @@
"translation": "**为何?**\n要想高效的工作就必须能迅速找到文件特别是当不知道或不记得文件*名*时。\n把相关的文件一起放在一个直观的位置可以节省时间。\n富有描述性的目录结构会让你和后面的维护者眼前一亮。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "<a href=\"#toc\">Back to top</a>",
"translation": "<a href=\"#toc\">回到顶部</a>",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "### Identify",
"translation": "### 识别",
@ -23469,6 +23754,11 @@
"translation": "还是根据你自己的舒适度而定吧。\n除非创建新文件夹能有显著的价值否则尽量使用扁平结构。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "<a href=\"#toc\">Back to top</a>",
"translation": "<a href=\"#toc\">回到顶部</a>",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "### _T-DRY_ (Try to be _DRY_)",
"translation": "### *T-DRY*(尽量不重复自己)",
@ -24164,6 +24454,11 @@
"translation": "**为何?**如果指令名也同时用作*输入*属性,而且指令名无法准确描述这个属性的用途时,应该使用别名。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "<a href=\"#toc\">Back to top</a>",
"translation": "<a href=\"#toc\">回到顶部</a>",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "### Member sequence",
"translation": "### 成员顺序",
@ -24269,6 +24564,11 @@
"translation": "**为何?**Angular 允许[另一种备选语法](guide/template-syntax#binding-syntax) `on-*`。如果事件的名字本身带有前缀`on`,那么绑定的表达式可能是`on-onEvent`。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "<a href=\"#toc\">Back to top</a>",
"translation": "<a href=\"#toc\">回到顶部</a>",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "### Put presentation logic in the component class",
"translation": "### 把表现层逻辑放到组件类里",
@ -24329,6 +24629,11 @@
"translation": "**为何?**一个元素可以使用多个属性型指令。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "<a href=\"#toc\">Back to top</a>",
"translation": "<a href=\"#toc\">回到顶部</a>",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/styleguide.md"
},
{
"original": "### _HostListener_/_HostBinding_ decorators versus _host_ metadata",
"translation": "### *HostListener* 和 *HostBinding* 装饰器 vs. 组件元数据 *host*",
@ -26004,11 +26309,6 @@
"translation": "[`NgModel`](guide/template-syntax#ngModel) - 双向绑定到HTML表单元素",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/template-syntax.md"
},
{
"original": "### NgClass",
"translation": "### NgClass 指令",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/template-syntax.md"
},
{
"original": "You typically control how elements appear\nby adding and removing CSS classes dynamically.\nYou can bind to the `ngClass` to add or remove several classes simultaneously.",
"translation": "我们经常用动态添加或删除 CSS 类的方式来控制元素如何显示。\n通过绑定到`NgClass`,可以同时添加或移除多个类。",
@ -26044,11 +26344,6 @@
"translation": "你既可以在初始化时调用`setCurrentClassess()`,也可以在所依赖的属性变化时调用。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/template-syntax.md"
},
{
"original": "### NgStyle",
"translation": "### NgStyle 指令",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/template-syntax.md"
},
{
"original": "You can set inline styles dynamically, based on the state of the component.\nWith `NgStyle` you can set many inline styles simultaneously.",
"translation": "我们可以根据组件的状态动态设置内联样式。\n`NgStyle`绑定可以同时设置多个内联样式。",
@ -26239,11 +26534,6 @@
"translation": "[NgForOf](guide/template-syntax#ngFor) - 对列表中的每个条目重复套用同一个模板",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/template-syntax.md"
},
{
"original": "### NgIf",
"translation": "### NgIf 指令",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/template-syntax.md"
},
{
"original": "You can add or remove an element from the DOM by applying an `NgIf` directive to\nthat element (called the _host element_).\nBind the directive to a condition expression like `isActive` in this example.",
"translation": "通过把`NgIf`指令应用到元素上(称为*宿主元素*我们可以往DOM中添加或从DOM中移除这个元素。\n在下面的例子中该指令绑定到了类似于`isActive`这样的条件表达式。",
@ -26309,11 +26599,6 @@
"translation": "参见稍后的[_安全导航操作符_](guide/template-syntax#safe-navigation-operator \"Safe naviation operator (?.)\")部分。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/template-syntax.md"
},
{
"original": "### NgForOf",
"translation": "### NgFor 指令",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/template-syntax.md"
},
{
"original": "`NgForOf` is a _repeater_ directive &mdash; a way to present a list of items.\nYou define a block of HTML that defines how a single item should be displayed.\nYou tell Angular to use that block as a template for rendering each item in the list.",
"translation": "`NgFor`是一个_重复器_指令 —— 自定义数据显示的一种方式。\n我们的目标是展示一个由多个条目组成的列表。首先定义了一个 HTML 块,它规定了单个条目应该如何显示。\n再告诉 Angular 把这个块当做模板,渲染列表中的每个条目。",
@ -30589,6 +30874,16 @@
"translation": "“快速上手”本身不需要这些类型定义,但是文档中的很多例子都需要。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/typescript-configuration.md"
},
{
"original": "### *target*",
"translation": "### *编译目标target*",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/typescript-configuration.md"
},
{
"original": "By default, the target is `es5`, you can configure the target to `es6` if you only want to deploy the application to\nes6 compatible browser. But if you configure the target to `es6` in some old browser such as `IE`, `Syntax Error` will be thrown.",
"translation": "默认情况下,编译目标是 `es5`,如果你只想发布到兼容 es6 的浏览器中,也可以把它配置为 `es6`。\n不过如果配置为 `es6`,那么一些老的浏览器(如 `IE` )中就会抛出 `Syntax Error` 错误。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/typescript-configuration.md"
},
{
"original": "## Preparation",
"translation": "## 准备工作",
@ -35901,7 +36196,7 @@
},
{
"original": "#### Try it",
"translation": "#### 试试",
"translation": "#### 试试",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/tutorial/toh-pt5.md"
},
{
@ -36351,7 +36646,7 @@
},
{
"original": "#### Try it",
"translation": "#### 试试",
"translation": "#### 试试",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/tutorial/toh-pt5.md"
},
{
@ -36459,11 +36754,6 @@
"translation": "在多个组件之间共享了`HeroService`服务。",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/tutorial/toh-pt5.md"
},
{
"original": "# HTTP",
"translation": "# HTTP 服务",
"sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/tutorial/toh-pt6.md"
},
{
"original": "In this tutorial, you'll add the following data persistence features with help from\nAngular's `HttpClient`.",
"translation": "在这节课中,你将借助 Angular 的 `HttpClient` 来添加一些数据持久化特性。",