From 49fd2eb76d8c7797f302672e536ed8b09c592f1c Mon Sep 17 00:00:00 2001 From: Zhicheng WANG Date: Tue, 1 Jan 2019 22:17:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E7=BA=AF=E7=B2=B9?= =?UTF-8?q?=E7=94=B1=E7=A9=BA=E6=A0=BC=E7=BB=84=E6=88=90=E7=9A=84=E8=A1=8C?= =?UTF-8?q?=EF=BC=8C=E5=AE=83=E4=BC=9A=E5=AF=BC=E8=87=B4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=20markdown=20=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/cli/index.md | 4 +- aio/content/guide/animations.md | 6 +- aio/content/guide/aot-compiler.md | 64 +++++++++---------- aio/content/guide/architecture-services.md | 2 +- aio/content/guide/architecture.md | 10 +-- aio/content/guide/build.md | 24 +++---- aio/content/guide/component-styles.md | 2 +- .../guide/dependency-injection-in-action.md | 4 +- aio/content/guide/dependency-injection.md | 4 +- aio/content/guide/elements.md | 8 +-- aio/content/guide/frequent-ngmodules.md | 4 +- aio/content/guide/glossary.md | 4 +- aio/content/guide/i18n.md | 16 ++--- aio/content/guide/npm-packages.md | 8 +-- aio/content/guide/providers.md | 2 +- aio/content/guide/quickstart.md | 2 +- aio/content/guide/route-animations.md | 2 +- aio/content/guide/router.md | 26 ++++---- .../guide/service-worker-getting-started.md | 2 +- aio/content/guide/testing.md | 2 +- aio/content/guide/universal.md | 6 +- aio/content/guide/upgrade-performance.md | 20 +++--- aio/content/translations/cn/about.md | 2 +- aio/content/translations/cn/nice-angular.md | 2 +- aio/content/tutorial/toh-pt0.md | 18 +++--- 25 files changed, 122 insertions(+), 122 deletions(-) diff --git a/aio/content/cli/index.md b/aio/content/cli/index.md index ab31895c26..a34e939610 100644 --- a/aio/content/cli/index.md +++ b/aio/content/cli/index.md @@ -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: ng build my-app -c production - + * Typically, the name of a generated artifact can be given as an argument to the command or specified with the --name option. 通常,生成的工件(artifact)名称可以作为命令的参数进行指定,也可以使用 --name 选项。 diff --git a/aio/content/guide/animations.md b/aio/content/guide/animations.md index dac0c1663d..10530de858 100644 --- a/aio/content/guide/animations.md +++ b/aio/content/guide/animations.md @@ -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) diff --git a/aio/content/guide/aot-compiler.md b/aio/content/guide/aot-compiler.md index d544cc2a9b..e8bef0dcd6 100644 --- a/aio/content/guide/aot-compiler.md +++ b/aio/content/guide/aot-compiler.md @@ -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: Literal object - + 对象字面量 @@ -803,7 +803,7 @@ The following table describes which expressions the _collector_ can and cannot f Calls - + 函数调用 @@ -819,7 +819,7 @@ The following table describes which expressions the _collector_ can and cannot f New - + 新建对象 @@ -835,14 +835,14 @@ The following table describes which expressions the _collector_ can and cannot f Property access - + 属性访问 yes, if target is foldable - + 如果目标对象也是可折叠的,则是 @@ -851,14 +851,14 @@ The following table describes which expressions the _collector_ can and cannot f Array index - + 数组索引访问 yes, if target and index are foldable - + 如果目标数组和索引都是可折叠的,则是 @@ -867,7 +867,7 @@ The following table describes which expressions the _collector_ can and cannot f Identity reference - + 引用标识符 @@ -906,7 +906,7 @@ The following table describes which expressions the _collector_ can and cannot f yes, if the substitutions are foldable - + 如果替换表达式是可折叠的,则是 @@ -979,14 +979,14 @@ The following table describes which expressions the _collector_ can and cannot f Supported prefix operator - + 受支持的前缀运算符 yes, if operand is foldable - + 如果操作数是可折叠的,则是 @@ -1027,7 +1027,7 @@ The following table describes which expressions the _collector_ can and cannot f Parentheses - + 括号 @@ -1116,18 +1116,18 @@ The compiler only supports metadata for these Angular decorators. @@ -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`.
- + Decorator 装饰器 - + - + Module - + 模块 - +
- + Value - + 值 - + - + Description - + 说明 - +
decorators - + Leave the decorators in place. This makes compilation faster. TypeScript will emit calls to the __decorate helper. Use --emitDecoratorMetadata for runtime reflection. However, the resulting code will not properly tree-shake. - + 把装饰器留在原地。这会让编译更快。TypeScript 会调用 __decorate 助手。使用 --emitDecoratorMetadata 来支持运行时反射。但是,这会导致代码无法被正确的摇树优化。 - +
static fields - + Replace decorators with a static field in the class. Allows advanced tree-shakers like Closure compiler to remove unused classes. - + 用类中的静态字段替换装饰器,允许使用 Closure compiler 等高级摇树优化器来删除未使用的类。 - +
diff --git a/aio/content/guide/architecture-services.md b/aio/content/guide/architecture-services.md index b444549a6b..dcc00c09b2 100644 --- a/aio/content/guide/architecture-services.md +++ b/aio/content/guide/architecture-services.md @@ -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, diff --git a/aio/content/guide/architecture.md b/aio/content/guide/architecture.md index 53e34343ee..fc36ac5ba2 100644 --- a/aio/content/guide/architecture.md +++ b/aio/content/guide/architecture.md @@ -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) diff --git a/aio/content/guide/build.md b/aio/content/guide/build.md index 3b818890c4..9c4c9d0def 100644 --- a/aio/content/guide/build.md +++ b/aio/content/guide/build.md @@ -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 - 任何一个文件的大小。 - + diff --git a/aio/content/guide/component-styles.md b/aio/content/guide/component-styles.md index 3e818846ae..682143e088 100644 --- a/aio/content/guide/component-styles.md +++ b/aio/content/guide/component-styles.md @@ -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/). diff --git a/aio/content/guide/dependency-injection-in-action.md b/aio/content/guide/dependency-injection-in-action.md index af1f16ecb1..bbf545c430 100644 --- a/aio/content/guide/dependency-injection-in-action.md +++ b/aio/content/guide/dependency-injection-in-action.md @@ -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 自己用的,在运行期间不存在。使用这种抽象类接口不但可以获得像接口一样的强类型,而且可以像普通类一样把它用作提供商令牌。 diff --git a/aio/content/guide/dependency-injection.md b/aio/content/guide/dependency-injection.md index bd76512ecd..86ff02e98c 100644 --- a/aio/content/guide/dependency-injection.md +++ b/aio/content/guide/dependency-injection.md @@ -376,9 +376,9 @@ The `@Injectable()` decorator is the standard decorator for service classes.
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()`。 diff --git a/aio/content/guide/elements.md b/aio/content/guide/elements.md index 9139e445da..c0eee33c96 100644 --- a/aio/content/guide/elements.md +++ b/aio/content/guide/elements.md @@ -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)。 - +
把组件转换成自定义元素会让所需的 Angular 基础设施也可用在浏览器中。创建自定义元素非常简单直接,它会自动把你的组件视图对接到变更检测和数据绑定机制,会把 Angular 的功能映射到原生 HTML 中的等价物。 @@ -229,11 +229,11 @@ The recently-developed [custom elements](https://developer.mozilla.org/en-US/doc Firefox - + Supported natively as of version 63. In older versions: Set the dom.webcomponents.enabled and dom.webcomponents.customelements.enabled preferences to true. - + 在 63 版中原生支持。对于老版本,可以把 dom.webcomponents.enableddom.webcomponents.customelements.enabled 首选项设置为 true。 - + diff --git a/aio/content/guide/frequent-ngmodules.md b/aio/content/guide/frequent-ngmodules.md index 3ddc111041..e3938e5113 100644 --- a/aio/content/guide/frequent-ngmodules.md +++ b/aio/content/guide/frequent-ngmodules.md @@ -149,9 +149,9 @@ Angular 应用需要不止一个模块,它们都为根模块服务。 When you want to use RouterLink,.forRoot(), and .forChild() - + 要使用路由功能,并且你要用到 RouterLink,.forRoot().forChild() 时 - + diff --git a/aio/content/guide/glossary.md b/aio/content/guide/glossary.md index 3d30e77604..9dc39b2c61 100644 --- a/aio/content/guide/glossary.md +++ b/aio/content/guide/glossary.md @@ -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 diff --git a/aio/content/guide/i18n.md b/aio/content/guide/i18n.md index 5b614ea418..442c43c6da 100644 --- a/aio/content/guide/i18n.md +++ b/aio/content/guide/i18n.md @@ -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). diff --git a/aio/content/guide/npm-packages.md b/aio/content/guide/npm-packages.md index c1b600bf4e..f32dcaf568 100644 --- a/aio/content/guide/npm-packages.md +++ b/aio/content/guide/npm-packages.md @@ -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) 中描述了这些包如何协作,以创建一个生产环境构建。 \ No newline at end of file diff --git a/aio/content/guide/providers.md b/aio/content/guide/providers.md index 83669f3ca7..9fad178232 100644 --- a/aio/content/guide/providers.md +++ b/aio/content/guide/providers.md @@ -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)。 diff --git a/aio/content/guide/quickstart.md b/aio/content/guide/quickstart.md index 0ebba06b68..51051b1ba7 100644 --- a/aio/content/guide/quickstart.md +++ b/aio/content/guide/quickstart.md @@ -215,7 +215,7 @@ As part of the initial app, the CLI created the first Angular component for you. 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. diff --git a/aio/content/guide/route-animations.md b/aio/content/guide/route-animations.md index 3dd3560dd3..c088f583b2 100644 --- a/aio/content/guide/route-animations.md +++ b/aio/content/guide/route-animations.md @@ -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.
This animation results in the `about` view sliding from the left to right. - + 使用缓动函数和持续时间定义的动画,让这个新视图滑入。
此动画将导致 `about` 视图从左向右滑动。 diff --git a/aio/content/guide/router.md b/aio/content/guide/router.md index b3d4601484..65b6104ef9 100644 --- a/aio/content/guide/router.md +++ b/aio/content/guide/router.md @@ -1712,7 +1712,7 @@ The starter app's structure looks like this: hero-list.component.ts - +
@@ -1738,7 +1738,7 @@ The starter app's structure looks like this: page-not-found.component.ts
- +
@@ -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 "Services" tutorial into the `hero-list.component.html` template. - + 从 教程的 "服务" 部分把 `heroes/heroes.component.html` 的内容复制到 `hero-list.component.html` 模板中。 * Relabel the `

` to `

HEROES

`. @@ -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`。 - +
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 元素树中标记和选中它们是很有用的。
@@ -3359,7 +3359,7 @@ hero-list page-not-found.component.ts
- + @@ -3398,7 +3398,7 @@ hero-list main.ts - +
@@ -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: - + The admin feature is now protected by the guard, albeit protected poorly. 管理特性区现在受此守卫保护了,不过这样的保护还不够。 diff --git a/aio/content/guide/service-worker-getting-started.md b/aio/content/guide/service-worker-getting-started.md index ea19b8d4b0..6eb966ddeb 100644 --- a/aio/content/guide/service-worker-getting-started.md +++ b/aio/content/guide/service-worker-getting-started.md @@ -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). diff --git a/aio/content/guide/testing.md b/aio/content/guide/testing.md index dde28a8137..b479e95fac 100644 --- a/aio/content/guide/testing.md +++ b/aio/content/guide/testing.md @@ -248,7 +248,7 @@ sudo: false language: node_js node_js: - "8" - + addons: apt: sources: diff --git a/aio/content/guide/universal.md b/aio/content/guide/universal.md index 1d6badef03..c8abfc2677 100644 --- a/aio/content/guide/universal.md +++ b/aio/content/guide/universal.md @@ -236,9 +236,9 @@ The following sections go into each of these main steps in more detail.
**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`。 - + { diff --git a/aio/content/guide/upgrade-performance.md b/aio/content/guide/upgrade-performance.md index c3deb16be2..54c864f20d 100644 --- a/aio/content/guide/upgrade-performance.md +++ b/aio/content/guide/upgrade-performance.md @@ -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)部分还是能为后续内容提供一些有用的上下文知识。 - +
@@ -165,14 +165,14 @@ other. This is known as "upgrading" and "downgrading".
Definitions: - + 定义: - _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 应用的方式。 diff --git a/aio/content/translations/cn/about.md b/aio/content/translations/cn/about.md index 3d77ca8651..22156d4e60 100644 --- a/aio/content/translations/cn/about.md +++ b/aio/content/translations/cn/about.md @@ -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 权威教程》) 的翻译工作。 diff --git a/aio/content/translations/cn/nice-angular.md b/aio/content/translations/cn/nice-angular.md index d4c4d157db..07260ab238 100644 --- a/aio/content/translations/cn/nice-angular.md +++ b/aio/content/translations/cn/nice-angular.md @@ -1,7 +1,7 @@ # Nice Angular 社区简介 ## Nice Angular 社区:QQ 群 - + - 278252889( Nice Angular 社区,2000 人已满) - 305739270( Nice Angular 社区二群,2000 人) - 207542263( Nice Angular 社区三群,1000 人) diff --git a/aio/content/tutorial/toh-pt0.md b/aio/content/tutorial/toh-pt0.md index 98894501e9..31c78a5ecf 100644 --- a/aio/content/tutorial/toh-pt0.md +++ b/aio/content/tutorial/toh-pt0.md @@ -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.