fix: 翻译了所有遗漏的部分。
This commit is contained in:
parent
7926c6fbe1
commit
a4ac40b640
@ -1598,6 +1598,8 @@ provider: [{ provide: Foo, useValue: { 0: 'test' } }]
|
||||
|
||||
Change the name of the property to something non-numeric.
|
||||
|
||||
把该属性的名字改为非数字类型。
|
||||
|
||||
```
|
||||
|
||||
// CORRECTED
|
||||
|
@ -892,15 +892,14 @@ by implementing the lifecycle hook interfaces.
|
||||
|
||||
> [**Pipes**](guide/pipes): Use pipes in your templates to improve the user experience by transforming values for display. Consider this `currency` pipe expression:
|
||||
>
|
||||
> > `price | currency:'USD':true`
|
||||
>
|
||||
> It displays a price of 42.33 as `$42.33`.
|
||||
|
||||
> [**管道**](guide/pipes):在模板中使用管道转换成用于显示的值,以增强用户体验。例如,`currency` 管道表达式:
|
||||
>
|
||||
> > `price | currency:'USD':true`
|
||||
>
|
||||
> It displays a price of 42.33 as `$42.33`.
|
||||
>
|
||||
> 它把价格“42.33”显示为 `$42.33`。
|
||||
>
|
||||
|
||||
> [**Router**](guide/router): Navigate from page to page within the client
|
||||
application and never leave the browser.
|
||||
|
@ -323,6 +323,8 @@ These are the polyfills required to run an Angular application on each supported
|
||||
|
||||
[ES7/reflect](guide/browser-support#core-es7-reflect) (JIT only)
|
||||
|
||||
[ES7/reflect](guide/browser-support#core-es7-reflect) (仅 JIT)
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
@ -270,6 +270,8 @@ The following code snippets illustrate how the same kind of operation is defined
|
||||
|
||||
Implied by promise resolution.
|
||||
|
||||
承诺被解析时隐式完成。
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@ -393,6 +395,9 @@ button.removeEventListener(‘click’, handler);
|
||||
<td>
|
||||
|
||||
Listen for keystrokes, but provide a stream representing the value in the input.
|
||||
|
||||
监听按键,提供一个流来表示这些输入的值。
|
||||
|
||||
<pre>fromEvent(inputEl, 'keydown').pipe(
|
||||
map(e => e.target.value)
|
||||
);</pre>
|
||||
@ -402,6 +407,9 @@ button.removeEventListener(‘click’, handler);
|
||||
<td>
|
||||
|
||||
Does not support configuration.
|
||||
|
||||
不支持配置。
|
||||
|
||||
<pre>element.addEventListener(eventName, (event) => {
|
||||
// Cannot change the passed Event into another
|
||||
// value before it gets to the handler
|
||||
|
@ -199,8 +199,12 @@ Angular 文档中提到“驼峰式命名法 (camelCase) ”的时候,所指
|
||||
|
||||
The Angular CLI is a `command line interface` tool that can create a project, add files, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.
|
||||
|
||||
Angular CLI 是个命令行接口(Command Line Interface)工具,它可以创建项目、添加文件以及执行各种正在进行的开发任务,比如测试、打包和部署。
|
||||
|
||||
Learn more in the [Getting Started](guide/quickstart) guide.
|
||||
|
||||
要了解更多,参见[快速起步](guide/quickstart)。
|
||||
|
||||
{@a component}
|
||||
|
||||
## Component
|
||||
@ -782,17 +786,22 @@ You rarely access Angular feature modules directly. You usually import them from
|
||||
|
||||
## NgModule
|
||||
|
||||
## 可观察对象 (observable)
|
||||
|
||||
Helps you organize an application into cohesive blocks of functionality.
|
||||
An NgModule identifies the components, directives, and pipes that the application uses along with the list of external NgModules that the application needs, such as `FormsModule`.
|
||||
|
||||
帮助你把应用组织成多个内聚的功能块。
|
||||
NgModule 表示应用的组件、指令和管道以及所用到的外部模块的列表,比如 `FormsModule`。
|
||||
|
||||
Every Angular application has an application root-module class. By convention, the class is
|
||||
called `AppModule` and resides in a file named `app.module.ts`.
|
||||
|
||||
每个 Angular 应用都有一个应用级根模块类。这类通常叫做 `AppModule`,并且位于一个名叫 `app.module.ts` 的文件中。
|
||||
|
||||
For details and examples, see [NgModules](guide/ngmodules) and the
|
||||
related files in that section.
|
||||
|
||||
要获得详情和范例,参见 [NgModule](guide/ngmodules) 及其相关文件。
|
||||
|
||||
{@a O}
|
||||
|
||||
## Observable
|
||||
|
@ -69,12 +69,16 @@ calls the lifecycle hook methods in the following sequence at specific moments:
|
||||
|
||||
Hook
|
||||
|
||||
钩子
|
||||
|
||||
</th>
|
||||
|
||||
<th>
|
||||
|
||||
Purpose and Timing
|
||||
|
||||
用途及时机
|
||||
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Types of Feature Modules
|
||||
|
||||
# 特性模块的分类
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
#### 前提条件
|
||||
|
@ -115,8 +115,9 @@ The following table summarizes the `@NgModule` metadata properties.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
The template is compiled within the context of an NgModule—the NgModule within which the template's component is declared—which determines the set of selectors using the following rules:
|
||||
|
||||
|
||||
该模板在 NgModule 环境中编译 —— 模板的组件是在该 NgModule 内部声明的,它会使用如下规则来确定这组选择器:
|
||||
|
||||
<ul>
|
||||
|
@ -80,7 +80,7 @@ The *devDependencies* are only necessary to *develop* the application.
|
||||
|
||||
{@a dependencies}
|
||||
|
||||
## *Dependencies*
|
||||
## *dependencies*
|
||||
|
||||
The `dependencies` section of `package.json` contains:
|
||||
|
||||
@ -193,7 +193,7 @@ which polyfills missing features for several popular browser.
|
||||
|
||||
{@a dev-dependencies}
|
||||
|
||||
## *DevDependencies*
|
||||
## *devDependencies*
|
||||
|
||||
The packages listed in the *devDependencies* section of the `package.json` help you develop the application on your local machine.
|
||||
|
||||
|
@ -401,6 +401,8 @@ It has a great deal of useful information including:
|
||||
|
||||
An `Observable` of the URL [fragment](#fragment) available to all routes.
|
||||
|
||||
一个适用于所有路由的 URL 的 [fragment(片段)](#fragment)的 `Observable`。
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@ -2371,11 +2373,9 @@ pattern and go to the same "Magneta" detail view.
|
||||
|
||||
<div class="callout is-helpful">
|
||||
|
||||
<header>
|
||||
<header>Route parameter: Required or optional?</header>
|
||||
|
||||
Route parameter: Required or optional?
|
||||
|
||||
</header>
|
||||
<header>路由参数:必须的还是可选的?</header>
|
||||
|
||||
Embedding the route parameter token, `:id`,
|
||||
in the route definition path is a good choice for this scenario
|
||||
|
@ -97,14 +97,14 @@ RxJS 提供了很多操作符(超过 150 个),不过只有少数是常用
|
||||
|
||||
</div>
|
||||
|
||||
| 类别 | 操作 |
|
||||
| :------------| :----------|
|
||||
| 创建 | `from`, `fromPromise`,`fromEvent`, `of` |
|
||||
| 组合 | `combineLatest`, `concat`, `merge`, `startWith` , `withLatestFrom`, `zip` |
|
||||
| 过滤 | `debounceTime`, `distinctUntilChanged`, `filter`, `take`, `takeUntil` |
|
||||
| 转换 | `bufferTime`, `concatMap`, `map`, `mergeMap`, `scan`, `switchMap` |
|
||||
| 工具 | `tap` |
|
||||
| 多播 | `share` |
|
||||
| <t>Area</t><t>类别</t> | <t>Operators</t><t>操作</t> |
|
||||
| :------------ | :---------- |
|
||||
| <t>Creation</t><t>创建</t> | `from`, `fromPromise`,`fromEvent`, `of` |
|
||||
| <t>Combination</t><t>组合</t> | `combineLatest`, `concat`, `merge`, `startWith` , `withLatestFrom`, `zip` |
|
||||
| <t>Filtering</t><t>过滤</t> | `debounceTime`, `distinctUntilChanged`, `filter`, `take`, `takeUntil` |
|
||||
| <t>Transformation</t><t>转换</t> | `bufferTime`, `concatMap`, `map`, `mergeMap`, `scan`, `switchMap` |
|
||||
| <t>Utility</t><t>工具</t> | `tap` |
|
||||
| <t>Multicasting</t><t>多播</t> | `share` |
|
||||
|
||||
## Error handling
|
||||
|
||||
|
@ -352,11 +352,9 @@ Node.js 和 npm 对使用 Angular 和其他平台进行现代网络开发是至
|
||||
Node 驱动客户端开发和构建工具。
|
||||
*npm* 包管理器本身是 *node* 应用,用于安装 JavaScript 库。
|
||||
|
||||
<a href="https://docs.npmjs.com/getting-started/installing-node" target="_blank" title="Installing Node.js and updating npm">
|
||||
Get them now</a> if they're not already installed on your machine.
|
||||
<a href="https://docs.npmjs.com/getting-started/installing-node" target="_blank" title="Installing Node.js and updating npm">Get them now</a> if they're not already installed on your machine.
|
||||
|
||||
如果你的电脑没有安装它们,<a href="https://docs.npmjs.com/getting-started/installing-node" target="_blank" title="安装 Node.js 和更新 npm">
|
||||
立刻安装它们</a>。
|
||||
如果你的电脑没有安装它们,请<a href="https://docs.npmjs.com/getting-started/installing-node" target="_blank" title="安装 Node.js 和更新 npm">现在安装</a>。
|
||||
|
||||
**Verify that you are running node `v4.x.x` or higher and npm `3.x.x` or higher**
|
||||
by running the commands `node -v` and `npm -v` in a terminal/console window.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Singleton services
|
||||
|
||||
# 单例应用
|
||||
|
||||
#### Prerequisites:
|
||||
|
||||
#### 前提条件:
|
||||
|
@ -371,6 +371,10 @@ Its intended source is implicit.
|
||||
Angular sets `let-hero` to the value of the context's `$implicit` property
|
||||
which `NgFor` has initialized with the hero for the current iteration.
|
||||
|
||||
这里并没有指定 `let-hero` 的上下文属性。它的来源是隐式的。
|
||||
Angular 将 `let-hero` 设置为此上下文中 `$implicit` 属性的值,
|
||||
它是由 `NgFor` 用当前迭代中的英雄初始化的。
|
||||
|
||||
* The [API guide](api/common/NgForOf "API: NgFor")
|
||||
describes additional `NgFor` directive properties and context properties.
|
||||
|
||||
|
@ -552,6 +552,8 @@ from the _source-to-view_, from _view-to-source_, and in the two-way sequence: _
|
||||
<td>
|
||||
|
||||
One-way<br>from data source<br>to view target
|
||||
|
||||
单向<br>从数据源<br>到视图
|
||||
|
||||
</td>
|
||||
|
||||
|
@ -2150,6 +2150,8 @@ to the looping value and listens for the component's `selected` event.
|
||||
|
||||
Here's the component's full definition:
|
||||
|
||||
下面是该组件的完整定义:
|
||||
|
||||
{@a dashboard-hero-component}
|
||||
|
||||
<code-example
|
||||
@ -2200,6 +2202,8 @@ The router seems particularly challenging.
|
||||
|
||||
The [discussion below](#routing-component) covers testing components that require the router.
|
||||
|
||||
[稍后的讨论](#routing-component)涵盖了那些需要路由器的测试组件。
|
||||
|
||||
</div>
|
||||
|
||||
The immediate goal is to test the `DashboardHeroComponent`, not the `DashboardComponent`,
|
||||
@ -4579,7 +4583,7 @@ Here are the most important static methods, in order of likely utility.
|
||||
|
||||
</tr>
|
||||
|
||||
</table
|
||||
</table>
|
||||
|
||||
A few of the `TestBed` instance methods are not covered by static `TestBed` _class_ methods.
|
||||
These are rarely needed.
|
||||
|
@ -1269,6 +1269,8 @@ compilation can pick it up.
|
||||
|
||||
You can then inject it in Angular using its class as a type annotation:
|
||||
|
||||
然后你就可以使用它的类作为类型注解将其在 Angular 中进行注入了:
|
||||
|
||||
<code-example path="upgrade-module/src/app/ajs-to-a-providers/hero-detail.component.ts" title="hero-detail.component.ts">
|
||||
|
||||
</code-example>
|
||||
|
Loading…
x
Reference in New Issue
Block a user