From ab067937052329a6622e2bef5996c7715992f104 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Sat, 10 Sep 2016 18:31:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E4=B8=8A=E6=AC=A1=E7=9A=84=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E6=9F=A5=E6=BC=8F=E8=A1=A5=E7=BC=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cookbook/component-relative-paths.jade | 2 +- .../latest/cookbook/visual-studio-2015.jade | 2 +- public/docs/ts/latest/guide/animations.jade | 2 +- .../ts/latest/guide/attribute-directives.jade | 3 +- .../ts/latest/guide/dependency-injection.jade | 2 +- public/docs/ts/latest/guide/index.jade | 2 +- public/docs/ts/latest/guide/ngmodule.jade | 31 +++++++++++++++++++ 7 files changed, 38 insertions(+), 6 deletions(-) diff --git a/public/docs/ts/latest/cookbook/component-relative-paths.jade b/public/docs/ts/latest/cookbook/component-relative-paths.jade index 46a7ca2f9b..214e2fbac5 100644 --- a/public/docs/ts/latest/cookbook/component-relative-paths.jade +++ b/public/docs/ts/latest/cookbook/component-relative-paths.jade @@ -227,7 +227,7 @@ a#webpack :marked Webpack will do a `require` behind the scenes to load the templates and styles. Read more [here](../guide/webpack.html#highlights). - + Webpack将会在幕后执行一次`require`来加载这些模板和样式。要了解更多,请参阅[这里](../guide/webpack.html#highlights)。 :marked See the [Introduction to Webpack](../guide/webpack.html). diff --git a/public/docs/ts/latest/cookbook/visual-studio-2015.jade b/public/docs/ts/latest/cookbook/visual-studio-2015.jade index 8514c383d8..f959aa441a 100644 --- a/public/docs/ts/latest/cookbook/visual-studio-2015.jade +++ b/public/docs/ts/latest/cookbook/visual-studio-2015.jade @@ -310,7 +310,7 @@ h2#build-and-run 第七步:编译和运行应用程序 "*Observable cannot be found*" indicate an old release of Visual Studio. Exit Visual Studio and follow the [instructions here](https://github.com/Microsoft/TypeScript/issues/8518). - 像“*Property ‘map’ does not exist on type ‘Observable’*”和“*Observable cannot be found*”这样的编译错误 + 像“*Property `map` does not exist on type `Observable`*”和“*Observable cannot be found*”这样的编译错误 说明Visual Studio的版本太老了。退出Visual Studio,按照[这里的指南](https://github.com/Microsoft/TypeScript/issues/8518)升级Visual Studio。 You'll be asked to replace the file diff --git a/public/docs/ts/latest/guide/animations.jade b/public/docs/ts/latest/guide/animations.jade index 813c07ec7d..04287ccfad 100644 --- a/public/docs/ts/latest/guide/animations.jade +++ b/public/docs/ts/latest/guide/animations.jade @@ -127,7 +127,7 @@ figure attaching it to one or more elements in the component's template using the "`[@triggerName]`" syntax: - 我们刚刚定义了一个动画,但它还没有被用到任何地方。要想使用它,可以在模板中用`@triggerName`语法来把它附加到一个或多个元素上。 + 我们刚刚定义了一个动画,但它还没有被用到任何地方。要想使用它,可以在模板中用`[@triggerName]`语法来把它附加到一个或多个元素上。 +makeExample('animations/ts/app/hero-list-basic.component.ts', 'template')(format=".") diff --git a/public/docs/ts/latest/guide/attribute-directives.jade b/public/docs/ts/latest/guide/attribute-directives.jade index 12c8fff4da..755729b0e6 100644 --- a/public/docs/ts/latest/guide/attribute-directives.jade +++ b/public/docs/ts/latest/guide/attribute-directives.jade @@ -121,6 +121,7 @@ block highlight-directive-1 我们先从Angular的`core`库中导入一些符号。 然后需要为`@Directive`装饰器导入`Directive`。 然后需要导入[注入](dependency-injection.html)到指令构造函数中的`ElementRef`,这样我们才能访问DOM元素。 + 还需要注入`Renderer`服务,以便更改DOM元素的样式。 虽然眼下还不需要`Input`,但在稍后的章节中很快就会用到它。 Then we define the directive metadata in a configuration object passed @@ -179,7 +180,7 @@ p `ElementRef` is a service that grants us direct access to the DOM element through its `nativeElement` property and with `Renderer` we can set the element style. - Angular会为每个被指令匹配上的元素创建一个该指令控制器类的实例,并把Angular的`ElementRef`注入进它的构造函数。 + Angular会为每个被指令匹配上的元素创建一个该指令控制器类的实例,并把Angular的`ElementRef`和`Renderer`注入进它的构造函数。 `ElementRef`是一个服务,它赋予我们直接访问DOM元素的能力。通过它的`nativeElement`属性和`Renderer`服务,我们可以设置元素的样式。 .l-main-section diff --git a/public/docs/ts/latest/guide/dependency-injection.jade b/public/docs/ts/latest/guide/dependency-injection.jade index e5e0bfdcf5..2110093ae5 100644 --- a/public/docs/ts/latest/guide/dependency-injection.jade +++ b/public/docs/ts/latest/guide/dependency-injection.jade @@ -460,7 +460,7 @@ block ctor-syntax :marked Read also **Should I add app-wide providers to the root `AppModule` or the root `AppComponent`?** in the [NgModule FAQ](../cookbook/ngmodule-faq.html#!#q-root-component-or-module) chapter. - 参见[NgModule FAQ](../cookbook/ngmodule-faq.html#!#q-root-component-or-module)一章的**我该把“全应用级”提供商加到根模块还是根组件?** + 参见[NgModule FAQ](../cookbook/ngmodule-faq.html#!#q-root-component-or-module)一章的**我该把“全应用级”提供商加到根模块`AppModule`还是根组件`AppComponent`?** :marked ### Preparing the HeroListComponent for injection diff --git a/public/docs/ts/latest/guide/index.jade b/public/docs/ts/latest/guide/index.jade index 609826a8c5..f5efd4973e 100644 --- a/public/docs/ts/latest/guide/index.jade +++ b/public/docs/ts/latest/guide/index.jade @@ -179,7 +179,7 @@ block example-links Look for a link to a running version of that sample near the top of each page, such as this from the [Architecture](architecture.html) page. - 在每页靠近顶部的地方都可以看到一个链接,指向这个范例的可执行版本,比如[架构](architecture.html)一章中的。 + 在每页靠近顶部的地方都可以看到一个链接,指向这个范例的可执行版本,比如[架构](architecture.html)一章中的。 The link launches a browser-based code editor where you can inspect, modify, save, and download the code. diff --git a/public/docs/ts/latest/guide/ngmodule.jade b/public/docs/ts/latest/guide/ngmodule.jade index b1c58cdaae..4429f51a78 100644 --- a/public/docs/ts/latest/guide/ngmodule.jade +++ b/public/docs/ts/latest/guide/ngmodule.jade @@ -33,38 +33,69 @@ block includes ## 目录 * [Angular modularity](#angular-modularity "Add structure to the app with NgModule") + * [Angular模块化](#angular-modularity "用NgModule把结构添加到应用中") * [The application root module](#root-module "The startup module that every app requires") + * [应用的根模块](#root-module "任何应用都需要的启动模块") * [Bootstrap](#bootstrap "Launch the app in a browser with the root module as the entry point") the root module + * [引导](#bootstrap "在浏览器中把根模块作为入口点来启动应用")根模块 * [Declarations](#declarations "Declare the components, directives, and pipes that belong to a module") + * [声明](#declarations "声明从属于模块的组件、指令和管道") * [Providers](#providers "Extend the app with additional services") + * [提供商](#providers "使用额外的服务来扩展该应用") * [Imports](#imports "Import components, directives, and pipes for use in component templates") + * [导入](#imports "为组件模板导入组件、指令和管道") * [Resolve conflicts](#resolve-conflicts "When two directives have the same selector ...") + * [解决冲突](#resolve-conflicts "当两个指令具有同一个选择器时……") * [Feature modules](#feature-modules "Partition the app into feature modules") + * [特性模块](#feature-modules "把应用分割成一些特性模块") * [Lazy loaded modules](#lazy-load "Load modules asynchronously") with the Router + * 通过路由器[延迟加载模块](#lazy-load "延迟加载模块") * [Shared modules](#shared-module "Create modules for commonly used components, directives, and pipes") + * [共享模块](#shared-module "为公用的组件、指令和管道创建模块") * [The Core module](#core-module "Create a core module with app-wide singleton services and single-use components") + * [核心模块](#core-module "用应用级单例服务和一次性组件创建核心模块") * [Configure core services with _forRoot_](#core-for-root "Configure providers during module import") + * [用_forRoot_配置核心服务](#core-for-root "在导入模块时配置提供商") * [Prevent reimport of the _CoreModule_](#prevent-reimport "because bad things happen if a lazy loaded module imports Core") + * [禁止重复导入_CoreModule_](#prevent-reimport "如果延迟加载模块导入了核心模块,就会出问题") * [NgModule metadata properties](#ngmodule-properties "A technical summary of the @NgModule metadata properties") + * [NgModule元数据的属性](#ngmodule-properties "对@NgModule元数据属性的技术性总结") ### Live examples + ### 在线例子 + This page explains Angular Modules through a progression of improvements to a sample with a "Tour of Heroes" theme. Here's an index to live examples at key moments in the evolution of that sample: + 此页面通过一个基于《英雄指南》的渐进式例子解释了Angular的模块。 + 这里是例子演化过程中一些关键节点的在线例子。 + * A minimal NgModule app + * 最小化的NgModule应用 * The first contact module + * 第一个联系人模块 * The revised contact module + * 修改过的联系人模块 * Just before adding _SharedModule_ + * 添加_SharedModule_之前 * The final version + * 最终版 ### Frequently Asked Questions (FAQs) + ### 常见问题 + This page covers Angular Module concepts in a tutorial fashion. + 该页面涵盖了英雄指南下的Angular模块概念。 + The companion [Angular Module FAQs](../cookbook/ngmodule-faq.html "Angular Module FAQs") cookbook offers ready answers to specific design and implementation questions. Read this page first before hopping over to those FAQs. + 烹饪宝典中的[Angular模块常见问题](../cookbook/ngmodule-faq.html "Angular模块常见问题")为一些与设计与实现有关的问题提供了答案。 + 不过在阅读FAQ之前,要先阅读此页面。 + .l-hr a#angular-modularity