fix: 移除纯粹由空格组成的行,它会导致错误的 markdown 编译

This commit is contained in:
Zhicheng WANG 2019-01-01 22:17:43 +08:00
parent b15f53133f
commit 49fd2eb76d
25 changed files with 122 additions and 122 deletions

View File

@ -91,7 +91,7 @@ Commands such as [add](cli/add) and [generate](cli/generate), which create or op
* See more about the [Workspace file structure](guide/file-structure).
欲知详情,参见[工作空间的文件结构](guide/file-structure)。
### Workspace and project configuration
### 工作空间与项目的配置
@ -145,7 +145,7 @@ Command syntax is shown as follows:
<code-example format="." language="bash">
ng build my-app -c production
</code-example>
* Typically, the name of a generated artifact can be given as an argument to the command or specified with the --name option.
通常生成的工件artifact名称可以作为命令的参数进行指定也可以使用 --name 选项。

View File

@ -586,15 +586,15 @@ You may also be interested in the following:
* [Transition and triggers](guide/transition-and-triggers)
[转场与触发器](guide/transition-and-triggers)
* [Complex animation sequences](guide/complex-animation-sequences)
[复杂动画序列](guide/complex-animation-sequences)
* [Reusable animations](guide/reusable-animations)
[可复用动画](guide/reusable-animations)
* [Route transition animations](guide/route-animations)
[路由转场动画](guide/route-animations)

View File

@ -142,7 +142,7 @@ When you use the Angular AOT compiler, you can control your app compilation in t
`tsconfig.json` 文件中提供模板编译选项。
For more information, see [Angular template compiler options](#compiler-options).
欲知详情,参见 [Angular 模板编译器选项](#compiler-options)。
* By [specifying Angular metadata](#metadata-aot).
@ -287,7 +287,7 @@ Define metadata objects with the following limited syntax:
<td>
Literal object
对象字面量
</td>
@ -803,7 +803,7 @@ The following table describes which expressions the _collector_ can and cannot f
<td>
Calls
函数调用
</td>
@ -819,7 +819,7 @@ The following table describes which expressions the _collector_ can and cannot f
<td>
New
新建对象
</td>
@ -835,14 +835,14 @@ The following table describes which expressions the _collector_ can and cannot f
<td>
Property access
属性访问
</td>
<td>
yes, if target is foldable
如果目标对象也是可折叠的,则是
</td>
@ -851,14 +851,14 @@ The following table describes which expressions the _collector_ can and cannot f
<td>
Array index
数组索引访问
</td>
<td>
yes, if target and index are foldable
如果目标数组和索引都是可折叠的,则是
</td>
@ -867,7 +867,7 @@ The following table describes which expressions the _collector_ can and cannot f
<td>
Identity reference
引用标识符
</td>
@ -906,7 +906,7 @@ The following table describes which expressions the _collector_ can and cannot f
<td>
yes, if the substitutions are foldable
如果替换表达式是可折叠的,则是
</td>
@ -979,14 +979,14 @@ The following table describes which expressions the _collector_ can and cannot f
<td>
Supported prefix operator
受支持的前缀运算符
</td>
<td>
yes, if operand is foldable
如果操作数是可折叠的,则是
</td>
@ -1027,7 +1027,7 @@ The following table describes which expressions the _collector_ can and cannot f
<td>
Parentheses
括号
</td>
@ -1116,18 +1116,18 @@ The compiler only supports metadata for these Angular decorators.
<table>
<tr>
<th>
Decorator
装饰器
</th>
<th>
Module
模块
</th>
</tr>
<tr>
@ -2274,12 +2274,12 @@ Similar to TypeScript Compiler, Angular Compiler also supports `extends` in the
The `extends` is a top level property parallel to `compilerOptions` and `angularCompilerOptions`.
The configuration from the base file are loaded first, then overridden by those in the inheriting config file.
Example:
像 TypeScript 编译器相似Angular 编译器也支持在 `tsconfig.json``angularCompilerOptions` 中使用 `extends` 语法。
tsconfig 文件可以 使用 `extends` 属性从其它文件中继承配置。
`extends` 位于顶级,和 `compilerOptions`、`angularCompilerOptions` 同级。
首先加载 base 文件中的配置,然后用当前配置文件中的选项进行覆盖。比如:
```json
{
"extends": "../tsconfig.base.json",
@ -2498,39 +2498,39 @@ annotations and decorators are unaffected. Default is `static fields`.
<table>
<tr>
<th>
Value
</th>
<th>
Description
说明
</th>
</tr>
<tr>
<td><code>decorators</code></td>
<td>
Leave the decorators in place. This makes compilation faster. TypeScript will emit calls to the __decorate helper. Use <code>--emitDecoratorMetadata</code> for runtime reflection. However, the resulting code will not properly tree-shake.
把装饰器留在原地。这会让编译更快。TypeScript 会调用 __decorate 助手。使用 <code>--emitDecoratorMetadata</code> 来支持运行时反射。但是,这会导致代码无法被正确的摇树优化。
</td>
</tr>
<tr>
<td><code>static fields</code></td>
<td>
Replace decorators with a static field in the class. Allows advanced tree-shakers like
<a href="https://github.com/google/closure-compiler">Closure compiler</a> to remove unused classes.
用类中的静态字段替换装饰器,允许使用 <a href="https://github.com/google/closure-compiler">Closure compiler</a> 等高级摇树优化器来删除未使用的类。
</td>
</tr>
</table>

View File

@ -149,7 +149,7 @@ or in the `@NgModule()` or `@Component()` metadata
and injects it into any class that asks for it.
Registering the provider in the `@Injectable()` metadata also allows Angular to optimize an app
by removing the service from the compiled app if it isn't used.
当你在根一级提供服务时Angular 会为 HeroService 创建一个单一的共享实例,并且把它注入到任何想要它的类中。这种在 `@Injectable` 元数据中注册提供商的方式还让 Angular 能够通过移除那些从未被用过的服务来优化大小。
* When you register a provider with a [specific NgModule](guide/architecture-modules), the same instance of a service is available to all components in that NgModule. To register at this level, use the `providers` property of the `@NgModule()` decorator,

View File

@ -258,23 +258,23 @@ Each of these subjects is introduced in more detail in the following pages.
[组件简介](guide/architecture-components)
* [Templates and views](guide/architecture-components#templates-and-views)
[模板与视图](guide/architecture-components#templates-and-views)
* [Component metadata](guide/architecture-components#component-metadata)
[组件元数据](guide/architecture-components#component-metadata)
* [Data binding](guide/architecture-components#data-binding)
[数据绑定](guide/architecture-components#data-binding)
* [Directives](guide/architecture-components#directives)
[指令](guide/architecture-components#directives)
* [Pipes](guide/architecture-components#pipes)
[管道](guide/architecture-components#pipes)
* [Introduction to services and dependency injection](guide/architecture-services)

View File

@ -307,29 +307,29 @@ Each budget entry is a JSON object with the following properties:
限制的类型。有效值为:
* bundle - The size of a specific bundle.
bundle - 特定包的大小。
* initial - The initial size of the app.
initial - 应用的初始大小。
* allScript - The size of all scripts.
allScript - 所有脚本的总大小。
* all - The size of the entire app.
all - 整个应用的总大小。
* anyScript - The size of any one script.
anyScript - 任何一个脚本的大小。
* any - The size of any file.
any - 任何一个文件的大小。
</td>
</tr>
<tr>

View File

@ -448,7 +448,7 @@ Choose from the following modes:
on the [MDN](https://developer.mozilla.org) site)
to attach a shadow DOM to the component's host element, and then puts the component
view inside that shadow DOM. The component's styles are included within the shadow DOM.
`ShadowDom` 模式使用浏览器原生的 Shadow DOM 实现(参见 [MDN](https://developer.mozilla.org) 上的 [Shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM))来为组件的宿主元素附加一个 Shadow DOM。组件的视图被附加到这个 Shadow DOM 中,组件的样式也被包含在这个 Shadow DOM 中。(译注:不进不出,没有样式能进来,组件样式出不去。)
* `Native` view encapsulation uses a now deprecated version of the browser's native shadow DOM implementation - [learn about the changes](https://hayato.io/2016/shadowdomv1/).

View File

@ -851,9 +851,9 @@ But they did neither.
`MinimalLogger` 在这里仅仅被用作一个 "依赖注入令牌"。
When you use a class this way, it's called a *class interface*.
当你通过这种方式使用类时,它称作*类接口*。
As mentioned in [DI Providers](guide/dependency-injection-providers#interface-not-valid-token), an interface is not a valid DI token because it is a TypeScript artifact that doesn't exist at run time. Use this abstract class interface to get the strong typing of an interface, and also use it as a provider token in the way you would a normal class.
就像 [DI 提供商](guide/dependency-injection-providers#interface-not-valid-token)中提到的那样,接口不是有效的 DI 令牌,因为它是 TypeScript 自己用的,在运行期间不存在。使用这种抽象类接口不但可以获得像接口一样的强类型,而且可以像普通类一样把它用作提供商令牌。

View File

@ -376,9 +376,9 @@ The `@Injectable()` decorator is the standard decorator for service classes.
<div class="alert is-helpful">
The decorator requirement is imposed by TypeScript. TypeScript normally discards parameter type information when it [transpiles](guide/glossary#transpile) the code to JavaScript. TypeScript preserves this information if the class has a decorator and the `emitDecoratorMetadata` compiler option is set `true` in TypeScript's `tsconfig.json` configuration file. The CLI configures `tsconfig.json` with `emitDecoratorMetadata: true`.
对装饰器的需求是 TypeScript 强制要求的。当 TypeScript 把代码[转译](guide/glossary#transpile)成 JavaScript 时,一般会丢弃参数的类型信息。只有当类具有装饰器,并且 `tsconfig.json` 中的编译器选项 `emitDecoratorMetadata``true`TypeScript 才会保留这些信息。CLI 所配置的 `tsconfig.json` 就带有 `emitDecoratorMetadata: true`
This means you're responsible for putting `@Injectable()` on your service classes.
这意味着你有责任给所有服务类加上 `@Injectable()`

View File

@ -33,7 +33,7 @@ Creating a custom element is simple and straightforward, and automatically conne
我们正在持续开发自定义元素功能,让它们可以用在由其它框架所构建的 Web 应用中。
Angular 框架的一个小型的、自包含的版本将会作为服务注入进去,以提供组件的变更检测和数据绑定功能。
要了解这个开发方向的更多内容,参见[这个视频演讲](https://www.youtube.com/watch?v=Z1gLFPLVJjY&t=4s)。
</div>
把组件转换成自定义元素会让所需的 Angular 基础设施也可用在浏览器中。创建自定义元素非常简单直接,它会自动把你的组件视图对接到变更检测和数据绑定机制,会把 Angular 的功能映射到原生 HTML 中的等价物。
@ -229,11 +229,11 @@ The recently-developed [custom elements](https://developer.mozilla.org/en-US/doc
<tr>
<td>Firefox</td>
<td>
Supported natively as of version 63. In older versions: Set the <code>dom.webcomponents.enabled</code> and <code>dom.webcomponents.customelements.enabled</code> preferences to true.
在 63 版中原生支持。对于老版本,可以把 <code>dom.webcomponents.enabled</code><code>dom.webcomponents.customelements.enabled</code> 首选项设置为 true。
</td>
</tr>
<tr>

View File

@ -149,9 +149,9 @@ Angular 应用需要不止一个模块,它们都为根模块服务。
<td>
When you want to use <code>RouterLink</code>,<code>.forRoot()</code>, and <code>.forChild()</code>
要使用路由功能,并且你要用到 <code>RouterLink</code>,<code>.forRoot()</code><code>.forChild()</code>
</td>
</tr>

View File

@ -162,7 +162,7 @@ For example, "convert_link_mode".
下划线形式underscore_case或叫蛇形形式snake_case在 Angular 中没有典型用法。蛇形形式使用下划线连接各个单词。
比如 "convert_link_mode"。
* UPPER_UNDERSCORE_CASE (or UPPER_SNAKE_CASE, or SCREAMING_SNAKE_CASE): Traditional for constants (acceptable, but prefer camelCase).
Upper snake case uses words in all capital letters connected with underscores. For example, "FIX_ME".
@ -754,7 +754,7 @@ A library isn't a complete Angular app and can't run independently.
* App developers can use the [CLI](guide/glossary#cli) to `add` a published library for use with an app in the same [workspace](guide/glossary#workspace).
应用开发者可以使用 [CLI](guide/glossary#cli) 来把一个已发布的库 `add` 进这个应用所在的[工作空间](guide/glossary#workspace)。
{@a lifecycle-hook}
## lifecycle hook

View File

@ -37,7 +37,7 @@ Angular 简化了国际化工作的下列几个方面:
* Preparing text in component templates for translation.
准备组件模板中待翻译的文本。
* Handling plural forms of words.
处理单词的复数形式。
@ -244,17 +244,17 @@ i18n 模板的翻译过程分为四个阶段
4. Merge the completed translation file into the app. To do this, use the Angular CLI `build` command to compile the app, choosing a [locale-specific configuration](#merge-aot), or specifying the following command options.
把翻译完成的文件合并回应用。要做到这一点,请使用 Angular CLI 的 `build` 命令来编译此应用,选择一个[区域相关的配置](#merge-aot),或指定下列命令选项。
* `--i18nFile`=*path to the translation file*
`--i18nFile`=*指向翻译文件的路径*
* `--i18nFormat`=*format of the translation file*
`--i18nFormat`=*此翻译文件的格式*
* `--i18nLocale`= *locale id*
`--i18nLocale`=*地区 ID*
The command replaces the original messages with translated text, and generates a new version of the app in the target language.
@ -696,7 +696,7 @@ If you don't use the CLI, you have two options:
For more information, see the [`ng xi18n` command documentation](cli/xi18n).
你可以直接使用来自 `@angular/compiler-cli` 包中的 `ng-xi18n` 工具。更多信息,参见 [`ng xi18n` 命令的文档](cli/xi18n)。
* You can use the CLI Webpack plugin `AngularCompilerPlugin` from the `@ngtools/webpack` package.
Set the parameters `i18nOutFile` and `i18nOutFormat` to trigger the extraction.
For more information, see the [Angular Ahead-of-Time Webpack Plugin documentation](https://github.com/angular/angular-cli/tree/master/packages/%40ngtools/webpack).

View File

@ -207,13 +207,13 @@ Package name | Description
## 相关信息
For information about how the Angular CLI handles packages see the following guides:
要了解 Angular CLI 如何处理包的更多信息,请参见下列章节:
* [Building and serving](guide/build) describes how packages come together to create a development build.
[Building and serving](guide/build) 描述了这些包如何协作,以进行开发期构建。
* [Deployment](guide/deployment) describes how packages come together to create a production build.
[Deployment](guide/deployment) 中描述了这些包如何协作,以创建一个生产环境构建。

View File

@ -169,7 +169,7 @@ You may also be interested in:
* [Tree-shakable Providers](guide/dependency-injection-providers#tree-shakable-providers).
[可摇树优化的服务提供商](guide/dependency-injection-providers#tree-shakable-providers)。
* [NgModule FAQ](guide/ngmodule-faq).
[NgModule 常见问题](guide/ngmodule-faq)。

View File

@ -215,7 +215,7 @@ As part of the initial app, the CLI created the first Angular component for you.
<code-example path="cli-quickstart/src/app/app.component.ts" region="component" header="src/app/app.component.ts" linenums="false"></code-example>
The browser reloads automatically with the revised title. That's nice, but it could look better.
浏览器将会用修改过的标题自动刷新。不错,但是还可以更好看。
3. Open `./src/app/app.component.css` and give the component some style.

View File

@ -229,7 +229,7 @@ The animation code does the following after styling the views:
* Slides in the new view by animating the view with an easing function and duration. <br />
This animation results in the `about` view sliding from the left to right.
使用缓动函数和持续时间定义的动画,让这个新视图滑入。<br />
此动画将导致 `about` 视图从左向右滑动。

View File

@ -1712,7 +1712,7 @@ The starter app's structure looks like this:
hero-list.component.ts
</div>
</div>
<div class='file'>
@ -1738,7 +1738,7 @@ The starter app's structure looks like this:
page-not-found.component.ts
</div>
</div>
<div class='file'>
@ -1869,7 +1869,7 @@ The **Routing Module** has several characteristics:
* Does **not** declare components.
**不要**声明组件。
{@a integrate-routing}
### Integrate routing with your app
@ -2077,7 +2077,7 @@ Follow these steps:
* Copy the contents of the `heroes/heroes.component.html` from
the <live-example name="toh-pt4" title="Tour of Heroes: Services example code">"Services" tutorial</live-example> into the `hero-list.component.html` template.
<live-example name="toh-pt4" title="Tour of Heroes: Services example code">教程的 "服务" 部分</live-example>`heroes/heroes.component.html` 的内容复制到 `hero-list.component.html` 模板中。
* Relabel the `<h2>` to `<h2>HEROES</h2>`.
@ -2098,17 +2098,17 @@ Follow these steps:
把在线例子中 `heroes/heroes.component.ts` 文件的内容复制到 `hero-list.component.ts` 文件中。
* Change the component class name to `HeroListComponent`.
把组件类名改为 `HeroListComponent`
* Change the `selector` to `app-hero-list`.
`selector` 改为 `app-hero-list`
<div class="alert is-helpful">
Selectors are **not required** for _routed components_ due to the components are dynamically inserted when the page is rendered, but are useful for identifying and targeting them in your HTML element tree.
对于**路由组件**来说,这些选择器**不是必须的**,因为这些组件是在渲染页面时动态插入的,不过选择器对于在 HTML 元素树中标记和选中它们是很有用的。
</div>
@ -3359,7 +3359,7 @@ hero-list
page-not-found.component.ts
</div>
</div>
</div>
@ -3398,7 +3398,7 @@ hero-list
main.ts
</div>
<div class='file'>
@ -3526,7 +3526,7 @@ Begin by imitating the heroes feature:
`src/app` 目录下创建一个 `crisis-center` 子目录。
* Copy the files and folders from `app/heroes` into the new `crisis-center` folder.
`app/heroes` 中的文件和目录复制到新的 `crisis-center` 文件夹中。
* In the new files, change every mention of "hero" to "crisis", and "heroes" to "crises".
@ -4635,7 +4635,7 @@ update the admin route with a `canActivate` guard property that references it:
</code-example>
The admin feature is now protected by the guard, albeit protected poorly.
管理特性区现在受此守卫保护了,不过这样的保护还不够。

View File

@ -53,7 +53,7 @@ The above command completes the following actions:
包含要添加到 `manifest.json` 文件中的链接。
* Adds meta tags for `theme-color`.
`theme-color` 添加 meta 标签。
5. Installs icon files to support the installed Progressive Web App (PWA).

View File

@ -248,7 +248,7 @@ sudo: false
language: node_js
node_js:
- "8"
addons:
apt:
sources:

View File

@ -236,9 +236,9 @@ The following sections go into each of these main steps in more detail.
<div class="alert is-helpful">
**Note:** The [Universal tutorial](#the-example) below walks you through the steps using the Tour of Heroes sample app, and goes into more detail about what you can do and why you might want to do it.
**注意:稍后的 **[Universal 教程](#the-example)将引导你基于 "英雄指南" 应用来完成各个步骤,并详细介绍你能做什么以及为什么要那么做。
To see a working version of an app with server-side rendering, clone the [Angular Universal starter](https://github.com/angular/universal-starter).
要亲自体验带服务端渲染功能的应用,请把 [Angular Universal starter](https://github.com/angular/universal-starter) 克隆下来试试。
@ -390,7 +390,7 @@ Copy `tsconfig.app.json` to `tsconfig.server.json` and modify it as follows:
* Add a section for `"angularCompilerOptions"` and set `"entryModule"` to point to your `AppServerModule` instance. Use the format `importPath#symbolName`. In this example, the entry module is `app/app.server.module#AppServerModule`.
添加一个 `"angularCompilerOptions"` 节,并把 `"entryModule"`(入口模块)指向你的 `AppServerModule` 实例,格式为 `importPath#symbolName`。在这个例子中,这个入口模块是 `app/app.server.module#AppServerModule`
<code-example format="." language="none" linenums="false">
{

View File

@ -75,7 +75,7 @@ upgrade/static} utilities remain the same. For more information, see the
[从 AngularJS 升级](guide/upgrade)中的[变更检测](guide/upgrade#change-detection)部分仅仅适用于使用 `UpgradeModule` 的应用。
虽然你处理变更检测的方式和 `downgradeModule()`(本章的重点)不同,不过读一下[变更检测](guide/upgrade#change-detection)部分还是能为后续内容提供一些有用的上下文知识。
</div>
@ -165,14 +165,14 @@ other. This is known as "upgrading" and "downgrading".
<div class="alert is-helpful">
<b>Definitions:</b>
<b>定义:</b>
- _Upgrading_: The act of making an AngularJS asset, such as a component or service, available to
the Angular part of the app.
*升级*:让 AngularJS 中的资产,比如组件或服务,可用于应用中的 Angular 部分。
- _Downgrading_: The act of making an Angular asset, such as a component or service, available to
the AngularJS part of the app.
@ -304,9 +304,9 @@ A few examples are:
- You use Angular for features that are only visible to specific types of users; for example,
logged-in users, administrators, or VIP members. You don't need to load Angular until a user is
authenticated.
你可以将 Angular 用于仅对特定类型的用户可见的特性,比如:登录用户、管理员或 VIP 成员。这样在用户通过了身份验证之前,你都无需加载 Angular。
- You use Angular for a feature that is not critical for the initial rendering of the app and you
can afford a small delay in favor of better initial load performance.
@ -519,14 +519,14 @@ To summarize, the key differentiating factors of `downgradeModule()` are:
1. It allows instantiating or even loading the Angular part lazily, which improves the initial
loading time. In some cases this may waive the cost of running a second framework altogether.
它允许实例化甚至惰性加载 Angular 部分,这能改善初始加载时间。某些情况下,这可能会完全免除启动第二个框架的成本。
2. It improves performance by avoiding unnecessary change detection runs while giving the developer
greater ability to customize.
通过避免运行不必要的变更检测,它提高了性能,给开发人员提供了更大的自定义能力。
3. It does not require you to change how you bootstrap your AngularJS app.
它不需要你更改引导 AngularJS 应用的方式。

View File

@ -120,7 +120,7 @@ Angular 和 Grails 开发高校[教务管理系统](http://www.github.com/jwgl)
- **严清**
AngularJS 中文社区的早期耕耘者,也是 AngularJS 1.x 的早期传道者之一。虽然他已经不再使用 AngularJS 技术栈,但其对社区的贡献和影响力不应忘记。
- **格茸扎西(破狼)**
AngularJS 中文社区系列 QQ 群的群主,从严清手里接下 QQ 群并长期维护。他还与译者之一的汪志成(雪狼)合著过一本书《 AngularJS 深度剖析与最佳实践》,这本书的成功让我们看到了中文社区对 Angular 的热情支持,最终激发了我们翻译 Angular 官网的行动。我们还共同完成了对国外新书 ng-book2中译本《Angular 权威教程》) 的翻译工作。

View File

@ -1,7 +1,7 @@
# Nice Angular 社区简介
## Nice Angular 社区QQ 群
- 278252889 Nice Angular 社区2000 人已满)
- 305739270 Nice Angular 社区二群2000 人)
- 207542263 Nice Angular 社区三群1000 人)

View File

@ -66,9 +66,9 @@ To create a new workspace and an initial app project:
要想创建一个新的工作空间和一个初始应用项目,需要:
1. Ensure that you are not already in an Angular workspace folder. For example, if you have previously created the Getting Started workspace, change to the parent of that folder.
确保你现在没有位于 Angular 工作区的文件夹中。例如,如果你之前已经创建过 "快速上手" 工作空间,请回到其父目录中。
2. Run the CLI command `ng new` and provide the name `angular-tour-of-heroes`, as shown here:
运行 CLI 命令 `ng new`,空间名请使用 `angular-tour-of-heroes`,如下所示:
@ -90,19 +90,19 @@ It also creates the following workspace and starter project files:
它还会创建下列工作空间和初始项目的文件:
* A new workspace, with a root folder named `angular-tour-of-heroes`.
新的工作空间,其根目录名叫 `angular-tour-of-heroes`
* An initial skeleton app project, also called `angular-tour-of-heroes` (in the `src` subfolder).
一个最初的骨架应用项目,同样叫做 `angular-tour-of-heroes`(位于 `src` 子目录下)。
* An end-to-end test project (in the e2e subfolder).
一个端到端测试项目(位于 e2e 子目录下)。
* Related configuration files.
相关的配置文件。
The initial app project contains a simple Welcome app, ready to run.