diff --git a/aio/content/guide/attribute-directives.md b/aio/content/guide/attribute-directives.md index a3bc6e21dd..4fc9241289 100644 --- a/aio/content/guide/attribute-directives.md +++ b/aio/content/guide/attribute-directives.md @@ -76,6 +76,8 @@ when the user hovers over that element. You can apply it like this: Please note that directives _do not_ support namespaces. +注意,指令**不支持**命名空间。 + ### Write the directive code diff --git a/aio/content/guide/creating-libraries.md b/aio/content/guide/creating-libraries.md index a9231c2805..5ef445cb83 100644 --- a/aio/content/guide/creating-libraries.md +++ b/aio/content/guide/creating-libraries.md @@ -12,6 +12,7 @@ A simple example might be a button that sends users to your company website, tha

For more details on how a library project is structured you can refer the Library Project Files

+

要了解关于库项目结构的更多信息,参见库项目文件

## Getting started diff --git a/aio/content/guide/deployment.md b/aio/content/guide/deployment.md index 698c4e2028..4eeb7b574c 100644 --- a/aio/content/guide/deployment.md +++ b/aio/content/guide/deployment.md @@ -92,7 +92,7 @@ This method is for development and testing only, and is not a supported or secur ### Basic deployment to a remote server -## 最简化的部署方式 +### 最简化的部署方式 For the simplest deployment, create a production build and copy the output directory to a web server. @@ -124,7 +124,7 @@ This is the simplest production-ready deployment of your application. ### Deploy to GitHub pages -## 发布到 GitHub pages(页面服务) +### 发布到 GitHub pages(页面服务) Another simple way to deploy your Angular app is to use [GitHub Pages](https://help.github.com/articles/what-is-github-pages/). diff --git a/aio/content/guide/glossary.md b/aio/content/guide/glossary.md index 85e655dc9a..4e750f61a5 100644 --- a/aio/content/guide/glossary.md +++ b/aio/content/guide/glossary.md @@ -1088,14 +1088,19 @@ See [Browser Support](guide/browser-support) for polyfills that support particul In the Angular CLI, a standalone application or [library](#library) that can be created or modified by a CLI command. +在 Angular CLI 中,CLI 命令可能会创建或修改独立应用或[库](#library)。 + A project, as generated by the [`ng new`](cli/new), contains the set of source files, resources, and configuration files that you need to develop and test the application using the CLI. Projects can also be created with the `ng generate application` and `ng generate library` commands. +由 [`ng new`](cli/new) 创建的项目中包含一组源文件、资源和配置文件,当你用 CLI 开发或测试此应用时就会用到它们。此外,还可以用 `ng generate application` 或 `ng generate library` 命令创建项目。 + For more information, see [Project File Structure](guide/file-structure). +欲知详情,参见[项目文件结构](guide/file-structure)。 + The [`angular.json`](guide/workspace-config) file configures all projects in a [workspace](#workspace). -在 Angular 中,是指[工作区](#workspace)中的一个文件夹,它包含 Angular 应用或[库](#library)。 -每个工作区中可以包含多个项目。工作区中的每个应用都可以使用同一工作区中的任意库。 +[`angular.json`](guide/workspace-config) 文件可以配置某个[工作空间](#workspace) 中的所有项目。 {@a provider} @@ -1234,10 +1239,12 @@ In [schematics](#schematic), a function that operates on a [file tree](#file-tre A scaffolding library that defines how to generate or transform a programming project by creating, modifying, refactoring, or moving files and code. A schematic defines [rules](#rule) that operate on a virtual file system called a [tree](#file-tree). +脚手架库会定义如何借助创建、修改、重构或移动文件和代码等操作来生成或转换某个项目。每个原理图定义了[一些规则](#rule),以操作一个被称为[文件树](#file-tree)的虚拟文件系统。 + + The [Angular CLI](#cli) uses schematics to generate and modify [Angular projects](#project) and parts of projects. -一种脚手架库,它会定义出要如何通过创建、修改、重构或移动文件和代码的方式生成或转换编程项目。 -Angular [CLI](#cli) 使用原理图来生成和修改 [Angular 项目](#project)及其各个部件。 +Angular [CLI](#cli) 使用原理图来生成和修改 [Angular 项目](#project)及其部件。 * Angular provides a set of schematics for use with the CLI. See the [Angular CLI command reference](cli). The [`ng add`](cli/add) command runs schematics as part of adding a library to your project. The [`ng generate`](cli/generate) command runs schematics to create apps, libraries, and Angular code constructs. @@ -1294,14 +1301,22 @@ Import a scoped package in the same way that you import a normal package. ## server-side rendering +## 服务端渲染 + A technique that generates static application pages on the server, and can generate and serve those pages in response to requests from browsers. It can also pre-generate pages as HTML files that you serve later. +一项在服务端生成静态应用页面的技术,它可以在对来自浏览器的请求进行响应时生成这些页面或用它们提供服务。 +它还可以提前把这些页面生成为 HTML 文件,以便稍后用它们来提供服务。 + This technique can improve performance on mobile and low-powered devices and improve the user experience by showing a static first page quickly while the client-side app is loading. The static version can also make your app more visible to web crawlers. +该技术可以增强手机和低功耗设备的性能,而且会在应用加载通过快速展示一个静态首屏来提升用户体验。这个静态版本还能让你的应用对网络蜘蛛更加友好。 + You can easily prepare an app for server-side rendering by using the [CLI](#cli) to run the [Angular Universal](#universal) tool, using the `@nguniversal/express-engine` [schematic](#schematic). +你可以通过 [CLI](#cli) 运行 [Angular Universal](#universal) 工具,借助 `@nguniversal/express-engine` [schematic](#schematic) 原理图来更轻松的让应用支持服务端渲染。 {@a service} @@ -1530,8 +1545,14 @@ A tool for implementing [server-side rendering](#server-side-rendering) of an An When integrated with an app, Universal generates and serves static pages on the server in response to requests from browsers. The initial static page serves as a fast-loading placeholder while the full application is being prepared for normal execution in the browser. +用来帮 Angular 应用实现[服务端渲染](#server-side-rendering)的工具。 +当与应用集成在一起时,Universal 可以在服务端生成静态页面并用它们来响应来自浏览器的请求。 +当浏览器正准备运行完整版应用的时候,这个初始的静态页可以用作一个可快速加载的占位符。 + To learn more, see [Angular Universal: server-side rendering](guide/universal). +欲知详情,参见 [Angular Universal: 服务端渲染](guide/universal)。 + {@a V} {@a view} diff --git a/aio/content/guide/pipes.md b/aio/content/guide/pipes.md index 9af60d40a2..d8c2aac35a 100644 --- a/aio/content/guide/pipes.md +++ b/aio/content/guide/pipes.md @@ -264,6 +264,9 @@ Note the following: 你使用自定义管道的方式和内置管道完全相同。 * You must include your pipe in the `declarations` array of the `AppModule` + + 你必须把这个管道添加到 `AppModule` 的 `declarations` 数组中。 + * If you choose to inject your pipe into a class, you must provide it in the `providers` array of your `NgModule`. 你必须在 `AppModule` 的 `declarations` 数组中包含这个管道。 diff --git a/aio/content/guide/service-worker-config.md b/aio/content/guide/service-worker-config.md index e85c195baa..f07987491f 100644 --- a/aio/content/guide/service-worker-config.md +++ b/aio/content/guide/service-worker-config.md @@ -316,9 +316,7 @@ For example, the string `3d12h` will cache content for up to three and a half da This duration string specifies the network timeout. The network timeout is how long the Angular service worker will wait for the network to respond before using a cached response, if configured to do so. `timeout` is a duration string, using the following unit suffixes: 这个表示持续时间的字符串用于指定网络超时时间。 -如果配置了它,Angular Service Worker 在开始使用缓存之前就会先等待网络给出响应,这个等待时间就是网络超时时间。 - -`timeout` 是一个表示持续时间的字符串,使用下列后缀单位: +如果配置了网络超时时间,Angular Service Worker 就会先等待这么长时间再使用缓存。`timeout` 是一个表示持续时间的字符串,使用下列后缀单位: * `d`: days diff --git a/aio/content/guide/service-worker-getting-started.md b/aio/content/guide/service-worker-getting-started.md index cee3bdafd0..5689b8bbbf 100644 --- a/aio/content/guide/service-worker-getting-started.md +++ b/aio/content/guide/service-worker-getting-started.md @@ -193,6 +193,7 @@ Notice that all of the files the browser needs to render this application are ca 关于这些配置的更多信息,请参见 [`ng build`](cli/build) 。
+ Pay attention to two key points: 注意如下两个关键点: diff --git a/aio/content/guide/template-syntax.md b/aio/content/guide/template-syntax.md index 6c68179866..5298286be0 100644 --- a/aio/content/guide/template-syntax.md +++ b/aio/content/guide/template-syntax.md @@ -237,9 +237,7 @@ In the following snippets, the `recommended` within double curly braces and the An expression may also refer to properties of the _template's_ context such as a template input variable, - `let customer`, or a template reference variable, `#customerInput`. - 表达式的上下文可以包括组件之外的对象。 比如[模板输入变量](guide/template-syntax#template-input-variable) (`let customer`)和[模板引用变量](guide/template-syntax#ref-vars)(`#customerInput`)就是备选的上下文对象之一。 @@ -3264,11 +3262,13 @@ You'll need this template operator when you turn on strict null checks. It's opt ## Built-in template functions +## 内置模板函数 + {@a any-type-cast-function} ### The `$any()` type cast function -## 类型转换函数 `$any()` +### 类型转换函数 `$any()` Sometimes a binding expression triggers a type error during [AOT compilation](guide/aot-compiler) and it is not possible or difficult to fully specify the type. To silence the error, you can use the `$any()` cast function to cast diff --git a/aio/content/guide/workspace-config.md b/aio/content/guide/workspace-config.md index dcf61940c2..acca2f954d 100644 --- a/aio/content/guide/workspace-config.md +++ b/aio/content/guide/workspace-config.md @@ -109,7 +109,8 @@ The following top-level configuration properties are available for each project, | `prefix` | Angular 所生成的选择器的前缀字符串。可以自定义它,以作为应用或功能区的标识。 | | `schematics` | A set of schematics that customize the `ng generate` sub-command option defaults for this project. See [Generation schematics](#schematics) below. | | `schematics` | 一组原理图(schematic),它可以为该项目自定义 `ng generate` 子命令的默认选项。 | -| `architect` | Configuration defaults for Architect builder targets for this project. 参见稍后的 [生成器原理图](#schematics)。 | +| `architect` | Configuration defaults for Architect builder targets for this project. | +| `architect` | 为本项目的各个构建器目标配置默认值。 | {@a schematics} ## Generation schematics