From 8f4caa7cb1b55f8515d12b4537a1227647beaf6e Mon Sep 17 00:00:00 2001 From: Zhicheng WANG Date: Mon, 3 Jun 2019 10:50:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E8=AE=A2=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=BF=BB=E8=AF=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/guide/attribute-directives.md | 2 +- aio/content/guide/build.md | 2 +- aio/content/guide/creating-libraries.md | 6 +++--- aio/content/guide/dependency-injection-in-action.md | 10 +++++++--- aio/content/guide/dependency-injection-providers.md | 2 +- aio/content/guide/dependency-injection.md | 2 +- aio/content/guide/deployment.md | 6 ------ 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/aio/content/guide/attribute-directives.md b/aio/content/guide/attribute-directives.md index 74153c1c04..a3bc6e21dd 100644 --- a/aio/content/guide/attribute-directives.md +++ b/aio/content/guide/attribute-directives.md @@ -92,7 +92,7 @@ ng generate directive highlight The CLI creates `src/app/highlight.directive.ts`, a corresponding test file `src/app/highlight.directive.spec.ts`, and _declares_ the directive class in the root `AppModule`. -CLI 会创建 `src/app/highlight.directive.ts` 及相应的测试文件(`.../spec.ts`),并且在根模块 `AppModule` 中声明这个指令类。 +CLI 会创建 `src/app/highlight.directive.ts` 及相应的测试文件(`src/app/highlight.directive.spec.ts`),并且在根模块 `AppModule` 中声明这个指令类。
diff --git a/aio/content/guide/build.md b/aio/content/guide/build.md index de4a400a4e..74fbddb26e 100644 --- a/aio/content/guide/build.md +++ b/aio/content/guide/build.md @@ -495,7 +495,7 @@ For example, to divert all calls for `http://localhost:4200/api` to a server run 1. Create a file `proxy.conf.json` in the projects `src/` folder, in the same directory as `package.json`. - 在项目的 `src/` 目录下创建一个 `proxy.conf.json` 文件,紧挨着 `package.json`。 + 在项目的 `src/` 目录下创建一个 `proxy.conf.json` 文件,和 `package.json` 放在同一目录下。 1. Add the following content to the new proxy file: diff --git a/aio/content/guide/creating-libraries.md b/aio/content/guide/creating-libraries.md index 8632d2d4d1..a9231c2805 100644 --- a/aio/content/guide/creating-libraries.md +++ b/aio/content/guide/creating-libraries.md @@ -68,7 +68,7 @@ The public API for your library is maintained in the `public-api.ts` file in you Anything exported from this file is made public when your library is imported into an application. Use an NgModule to expose services and components. -库的公共 API 是在库文件夹下的 `index.ts` 文件中维护的。当你的库被导入应用时,从该文件导出的所有内容都会公开。请使用 NgModule 来暴露这些服务和组件。 +库的公共 API 是在库文件夹下的 `public-api.ts` 文件中维护的。当你的库被导入应用时,从该文件导出的所有内容都会公开。请使用 NgModule 来暴露这些服务和组件。 Your library should supply documentation (typically a README file) for installation and maintenance. @@ -162,11 +162,11 @@ A library can include [schematics](guide/glossary#schematic) that allow it to in * Include an update schematic so that `ng update` can update your library’s dependencies and provide migrations for breaking changes in new releases. - 包含一个更新型 schematic ,以便 `ng update` 可以更新此库的依赖,并针对新版本中的破坏性变更提供辅助迁移。 + 包含一个更新(update)schematic ,以便 `ng update` 可以更新此库的依赖,并针对新版本中的破坏性变更提供辅助迁移。 To learn more, see [Schematics Overview](guide/schematics) and [Schematics for Libraries](guide/schematics-for-libraries). -要了解更多信息,参见 [Schematic - 简介](https://blog.angular.io/schematics-an-introduction-dc1dfbc2a2b2) 。 +要了解更多信息,参见 [原理图概览](guide/schematics) 和 [供库使用的原理图](guide/schematics-for-libraries)。 ## Publishing your library diff --git a/aio/content/guide/dependency-injection-in-action.md b/aio/content/guide/dependency-injection-in-action.md index fd7b5d81a9..55e11e729c 100644 --- a/aio/content/guide/dependency-injection-in-action.md +++ b/aio/content/guide/dependency-injection-in-action.md @@ -224,7 +224,7 @@ through the injector tree until it reaches the root injector. * If no provider is found in the root injector, the DI framework throws an error. - 如果在根注入器中也没有找到提供商,则 DI 框架将会给构造函数返回一个 null。 + 如果在根注入器中也没有找到提供商,则 DI 框架将会抛出一个错误。 There are a number of options for modifying the default search behavior, using _parameter decorators_ on the service-valued parameters of a class constructor. @@ -880,9 +880,13 @@ The `MinimalLogger` transpiles to this unoptimized, pre-minified JavaScript for Notice that it doesn't have any members. It never grows no matter how many members you add to the class, -as long as those members are typed but not implemented.Look again at the TypeScript `MinimalLogger` class to confirm that it has no implementation. +as long as those members are typed but not implemented. -注意,***只要不实现它***,不管添加多少成员,它永远不会增长大小,因为这些成员虽然是有类型的,但却没有实现。你可以再看看 TypeScript 的 `MinimalLogger` 类,确定一下它是没有实现的。 +注意,***只要不实现它***,不管添加多少成员,它都不会增长大小,因为这些成员虽然是有类型的,但却没有实现。 + +Look again at the TypeScript `MinimalLogger` class to confirm that it has no implementation. + +你可以再看看 TypeScript 的 `MinimalLogger` 类,确定一下它是没有实现的。
diff --git a/aio/content/guide/dependency-injection-providers.md b/aio/content/guide/dependency-injection-providers.md index b79304dd62..a1f8ddee79 100644 --- a/aio/content/guide/dependency-injection-providers.md +++ b/aio/content/guide/dependency-injection-providers.md @@ -506,7 +506,7 @@ You can then import this module into your application module to make the service available for injection in your app, as in the following example. -该模块以后可以导入到你的应用模块中,以便该服务可注入到你的应用中,例子如下。 +你可以把该模块导入到你的应用模块中,以便该服务可注入到你的应用中,例子如下。 diff --git a/aio/content/guide/dependency-injection.md b/aio/content/guide/dependency-injection.md index 2371ced58e..71b1c7d4d7 100644 --- a/aio/content/guide/dependency-injection.md +++ b/aio/content/guide/dependency-injection.md @@ -289,7 +289,7 @@ you can still inject application-wide services into these components. A component's injector is a child of its parent component's injector, and inherits from all ancestor injectors all the way back to the application's _root_ injector. Angular can inject a service provided by any injector in that lineage. 借助[注入器继承机制](guide/hierarchical-dependency-injection),你仍然可以把全应用级的服务注入到这些组件中。 -组件的注入器是其父组件注入器的子节点,也是其父节点的父节点的后代,以此类推,直到应用的*根*注入器为止。 +组件的注入器是其父组件注入器的子节点,它会继承所有的祖先注入器,其终点则是应用的*根*注入器。 Angular 可以注入该继承谱系中任何一个注入器提供的服务。 For example, Angular can inject `HeroListComponent` with both the `HeroService` provided in `HeroComponent` and the `UserService` provided in `AppModule`. diff --git a/aio/content/guide/deployment.md b/aio/content/guide/deployment.md index 2e0e7cb0ea..fa183f16f2 100644 --- a/aio/content/guide/deployment.md +++ b/aio/content/guide/deployment.md @@ -567,8 +567,6 @@ The Angular CLI uses two configurations for differential loading: - Browserslist - The `browserslist` configuration file is included in your application [project structure](guide/file-structure#application-configuration-files) and provides the minimum browsers your application supports. See the [Browserslist spec](https://github.com/browserslist/browserslist) for complete configuration options. - tsconfig.json - The `target` in the TypeScript `compilerOptions` determines the ECMAScript target version that the code is compiled to. Modern browsers support ES2015 natively, while ES5 is more commonly used to support legacy browsers. -在构建之前,`ng build` 和 `ng serve` 都会清空输出目录,但是只有 `ng build` 命令才会把生成的构建成果写入到输出目录下。 -
**Note:** Differential loading is currently only supported when using `es2015` as a compilation `target`. When used with targets higher than `es2015`, a warning is emitted during build time. @@ -628,10 +626,6 @@ not IE 9-11 # For IE 9-11 support, remove 'not'. The `tsconfig.json` looks like this: - -`ng serve` 命令会构建、监视并使用本地开发服务器从内存中提供网站服务。 -但是,当你将应用部署到其它服务器时,你可能希望仍然能持续看到你对该应用所做的修改。这时候,你可以为 `ng build` 命令添加 `--watch` 选项来做到这一点。 - ``` { "compileOnSave": false,