2017-05-26 15:28:06 -04:00
# Change Log
2017-02-22 13:09:39 -05:00
2017-07-29 12:03:22 -04:00
# 变更记录
2017-03-27 11:08:53 -04:00
2017-02-22 13:09:39 -05:00
The Angular documentation is a living document with continuous improvements.
This log calls attention to recent significant changes.
2018-03-22 05:18:48 -04:00
Angular 的文档将持续不断的更新和改进。本日志记录了近期最重要的变更。
2017-07-22 23:51:25 -04:00
2017-03-27 11:08:53 -04:00
## Updated to Angular 4.0. Documentation for Angular 2.x can be found at [v2.angular.io](https://v2.angular.io).
2017-07-22 23:51:25 -04:00
## 更新到 Angular 4.0 。Angular 2.x 的文档在 [v2.angular.io](https://v2.angular.io) 。
2017-04-30 16:10:32 -04:00
## All mention of moduleId removed. "Component relative paths" guide deleted (2017-03-13)
2017-07-22 23:51:25 -04:00
2018-03-22 05:30:09 -04:00
## 移除了所有的 moduleId 引用。移除了“组件相对路径” 的指南。(2017-03-13)
2018-03-01 09:19:59 -05:00
2017-03-27 11:08:53 -04:00
We added a new SystemJS plugin (systemjs-angular-loader.js) to our recommended SystemJS configuration.
This plugin dynamically converts "component-relative" paths in templateUrl and styleUrls to "absolute paths" for you.
2018-03-20 05:09:18 -04:00
我们往建议的 SystemJS 配置中新增了一个 SystemJS 插件 (systemjs-angular-loader.js) 。
这个插件可以帮你把 templateUrl 和 styleUrls 中的组件相对路径动态转换为绝对路径。
2017-07-22 23:51:25 -04:00
2017-03-27 11:08:53 -04:00
We strongly encourage you to only write component-relative paths.
That is the only form of URL discussed in these docs. You no longer need to write @Component ({ moduleId: module.id }), nor should you.
2017-07-22 23:51:25 -04:00
我们强烈建议你只写组件相对路径。
2018-03-20 05:09:18 -04:00
这也是本文档中所使用的唯一形式。你不必再写 `@Component({ moduleId: module.id })` ,而且也不应该再这么写。
2017-07-22 23:51:25 -04:00
2017-03-06 05:43:33 -05:00
## NEW: Downloadable examples for each guide (2017-02-28)
2017-07-22 23:51:25 -04:00
## 新增:每篇指南都增加了可下载的范例程序 (2017-02-28)
2017-03-06 05:43:33 -05:00
Now you can download the sample code for any guide and run it locally.
Look for the new download links next to the "live example" links.
2017-07-22 23:51:25 -04:00
现在你可以为任何一篇指南下载范例程序,并且在本地运行它了。
请在“在线例子”的链接后面查找新的下载链接。
2017-02-22 13:09:39 -05:00
## Template Syntax/Structural Directives: refreshed (2017-02-06)
2017-07-22 23:51:25 -04:00
## 模板语法/结构型指令:更新了 (2017-02-06)
2017-03-11 10:36:40 -05:00
The [_Template-Syntax_ ](guide/template-syntax ) and [_Structural Directives_ ](guide/structural-directives )
2017-02-22 13:09:39 -05:00
guides were significantly revised for clarity, accuracy, and current recommended practices.
Discusses `<ng-container>` .
Revised samples are more clear and cover all topics discussed.
2017-07-22 23:51:25 -04:00
对[模板语法](guide/template-syntax) 和 [结构型指令 ](guide/structural-directives )这两篇指南做了大幅修改,来让它们更加清晰、准确,并符合当前的最佳实践。
2018-03-20 05:09:18 -04:00
讨论了 `<ng-container>` 。
2017-07-30 00:43:20 -04:00
修改了例子,来让它们更清晰,并且涵盖了所有讨论到的主题。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## NEW: Samples re-structured with `src/` folder (2017-02-02)
2017-07-22 23:51:25 -04:00
2018-03-20 05:09:18 -04:00
## 新增:调整了范例程序的结构,移到了 `src/` 文件夹 (2017-02-02)
2017-07-22 23:51:25 -04:00
2017-03-11 08:44:25 -05:00
All documentation samples have been realigned with the default folder structure of the Angular CLI.
That's a step along the road to basing the sample in the Angular CLI.
2017-07-16 06:32:22 -04:00
But it's also good in its own right.
2017-02-22 13:09:39 -05:00
It helps clearly separate app code from setup and configuration files.
2018-03-20 05:09:18 -04:00
所有的文档范例都已经向 Angular CLI 的默认文件夹结构看齐了。
这是把范例迁移到 Angular CLI 过程中的一步。
2018-03-22 05:18:48 -04:00
不过也不仅是为了迁移,它还能把应用代码从环境准备代码和配置代码中清晰地分离出来。
2017-07-22 23:51:25 -04:00
2017-03-11 08:44:25 -05:00
All samples now have a `src/` folder at the project root.
2017-07-16 06:32:22 -04:00
The former `app/` folder moves under `src/` .
Read about moving your existing project to this structure in
2017-04-24 14:23:45 -04:00
< a href = "https://github.com/angular/quickstart#updating-to-a-newer-version-of-the-quickstart-repo" target = "Migrating samples/quickstart app to the src folder" >
2017-02-22 13:09:39 -05:00
the QuickStart repo update instructions< / a > .
2018-03-22 05:18:48 -04:00
所有的范例都改成了使用项目根目录下的 `src/` 文件夹。
2018-03-20 05:09:18 -04:00
也就是把以前的 `app/` 文件夹移到了 `src/` 文件夹下面。
要了解如何对你的现有项目进行这种迁移,请参阅< a href = "https://github.com/angular/quickstart#updating-to-a-newer-version-of-the-quickstart-repo" target = "_blank" target = "把范例中的应用迁移到 src 文件夹" > QuickStart 中的迁移指南< / a > 。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
Notably:
2017-03-31 19:57:13 -04:00
2017-07-22 23:51:25 -04:00
要点:
2017-02-22 13:09:39 -05:00
* `app/main.ts` moved to `src/main.ts` .
2017-07-22 23:51:25 -04:00
2018-03-20 05:09:18 -04:00
把 `app/main.ts` 移到 `src/main.ts` 。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
* `app/` moved to `src/app/` .
2018-03-03 08:06:01 -05:00
2018-03-20 05:09:18 -04:00
把 `app/` 移到 `src/app/` 。
2018-03-03 08:06:01 -05:00
2017-02-22 13:09:39 -05:00
* `index.html` , `styles.css` and `tsconfig.json` moved inside `src/` .
2017-07-22 23:51:25 -04:00
2018-03-20 05:09:18 -04:00
把 `index.html` 、`styles.css` 和 `tsconfig.json` 移到 `src/` 中。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
* `systemjs.config.js` now imports `main.js` instead of `app` .
2017-07-22 23:51:25 -04:00
2018-03-20 05:09:18 -04:00
`systemjs.config.js` 现在要导入 `main.js` 而不是 `app` 。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
* Added `lite-server` configuration (`bs-config.json`) to serve `src/` .
2018-03-20 05:09:18 -04:00
新增了一个 `lite-server` 配置(`bs-config.json`)以便在 `src/` 下启动开发服务器。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## NEW: Reactive Forms guide (2017-01-31)
2017-07-22 23:51:25 -04:00
## 新增: 响应式( Reactive) 表单指南 (2017-01-31)
2017-03-11 10:36:40 -05:00
The new [**Reactive Forms** ](guide/reactive-forms ) guide explains how and why to build a "reactive form".
2017-02-22 13:09:39 -05:00
"Reactive Forms" are the code-based counterpart to the declarative "Template Driven" forms approach
2017-03-11 10:36:40 -05:00
introduced in the [Forms ](guide/forms ) guide.
2017-07-16 06:32:22 -04:00
Check it out before you decide how to add forms to your app.
Remember also that you can use both techniques in the same app,
2017-02-22 13:09:39 -05:00
choosing the approach that best fits each scenario.
2017-07-22 23:51:25 -04:00
新的[**响应式表单**](guide/reactive-forms)指南解释了如何以及何时构建“响应式表单”。
“响应式表单”是基于代码的表单构建方式,与[表单](guide/forms)中介绍的声明“模板驱动”表单的方法相对。
在你决定如何往应用中添加表单之前,建议先读读那一章。
同时,别忘了你可以在同一个应用中同时使用这两种技术,根据场景来选择最合适的方法。
2017-02-22 13:09:39 -05:00
## NEW: Deployment guide (2017-01-30)
2017-03-31 19:57:13 -04:00
2017-07-22 23:51:25 -04:00
## 新增:部署指南 (2017-01-30)
2017-03-11 10:36:40 -05:00
The new [Deployment ](guide/deployment ) guide describes techniques for putting your application on a server.
2017-02-22 13:09:39 -05:00
It includes important advice on optimizing for production.
2017-07-22 23:51:25 -04:00
新的[部署指南](guide/deployment)讲的是如何把应用放到服务器上。
其中包括了为生产环境进行优化的重要建议。
2017-02-22 13:09:39 -05:00
## Hierarchical Dependency Injection: refreshed (2017-01-13)
2017-03-31 19:57:13 -04:00
2017-07-22 23:51:25 -04:00
## 多级依赖注入:更新完毕 (2017-01-13)
2017-03-11 10:36:40 -05:00
[Hierarchical Dependency Injection ](guide/hierarchical-dependency-injection ) guide is significantly revised.
2017-03-11 08:44:25 -05:00
Closes issue #3086 .
2018-03-03 08:06:01 -05:00
Revised samples are clearer and cover all topics discussed.
2017-07-22 23:51:25 -04:00
2018-03-20 05:09:18 -04:00
[多级依赖注入 ](guide/hierarchical-dependency-injection )做了显著修改。关闭了 issue #3086 。修改过的范例更加清晰,而且涵盖了讨论到的全部主题。
2017-02-22 13:09:39 -05:00
## Miscellaneous (2017-01-05)
2017-03-31 19:57:13 -04:00
2018-02-28 00:43:40 -05:00
## 杂项 (2017-01-05)
2018-03-03 08:06:01 -05:00
* [Setup ](guide/setup ) guide:
added (optional) instructions on how to remove _non-essential_ files.
2018-02-28 00:43:40 -05:00
2018-03-06 21:51:31 -05:00
[环境搭建 ](guide/setup )指南:
2018-02-28 00:43:40 -05:00
添加了(可选的)步骤说明,告诉你如何移除*非核心*文件。
2018-03-03 08:06:01 -05:00
2017-02-22 13:09:39 -05:00
* No longer consolidate RxJS operator imports in `rxjs-extensions` file; each file should import what it needs.
2018-03-03 08:06:01 -05:00
2018-03-20 05:09:18 -04:00
不再在 `rxjs-extensions` 文件中统一导入 RxJS 的操作符,每个文件应该各自导入它自己所需的。
2017-07-22 23:51:25 -04:00
2017-03-11 08:44:25 -05:00
* All samples prepend template/style URLs with `./` as a best practice.
2017-07-22 23:51:25 -04:00
2018-03-20 05:09:18 -04:00
所有范例都在模板/样式的 URL 之前添加 `./` 前缀 …… 而且你在实际开发中也应该这么做。
2017-07-22 23:51:25 -04:00
2017-04-21 20:21:45 -04:00
* [Style Guide ](guide/styleguide ): copy edits and revised rules.
2017-02-22 13:09:39 -05:00
2018-03-03 08:06:01 -05:00
[风格指南 ](guide/styleguide ):复制了编辑过的和修改过的规则。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## Router: more detail (2016-12-21)
2017-03-31 19:57:13 -04:00
2017-07-22 23:51:25 -04:00
## 路由:更详细 (2016-12-21)
2017-07-16 06:32:22 -04:00
Added more information to the [Router ](guide/router ) guide
2017-02-22 13:09:39 -05:00
including sections named outlets, wildcard routes, and preload strategies.
2017-07-22 23:51:25 -04:00
往[路由指南](guide/router)中添加了更多信息, 包括“命名出口( Outlet) ”、通配符路由和预加载策略。
2017-03-11 08:44:25 -05:00
## HTTP: how to set default request headers (and other request options) (2016-12-14)
2017-03-31 19:57:13 -04:00
2017-07-22 23:51:25 -04:00
## Http: 如何设置默认的请求头( 以及其它配置项) (2016-12-14)
2017-07-16 06:32:22 -04:00
Added section on how to set default request headers (and other request options) to
HTTP guide.
2017-02-22 13:09:39 -05:00
2017-07-30 00:32:56 -04:00
添加了一节“如何设置默认的请求头(以及其它配置项)”
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## Testing: added component test plunkers (2016-12-02)
2017-03-31 19:57:13 -04:00
2018-03-20 05:09:18 -04:00
## 测试:添加了组件测试的 plunker 范例 (2016-12-02)
2017-07-22 23:51:25 -04:00
2017-07-16 06:32:22 -04:00
Added two plunkers that each test _one simple component_ so you can write a component test plunker of your own: < live-example name = "setup" plnkr = "quickstart-specs" > one</ live-example > for the QuickStart seed's `AppComponent` and < live-example name = "testing" plnkr = "banner-specs" > another</ live-example > for the Testing guide's `BannerComponent` .
2017-10-27 18:48:50 -04:00
Linked to these plunkers in "Testing" and "Setup anatomy" guides.
2017-02-22 13:09:39 -05:00
2018-03-20 05:09:18 -04:00
添加了两个 plunker 例子,每个都测试一个简单的组件,以便你可以自己在 plunker 中写组件测试:< live-example name = "setup" plnkr = "quickstart-specs" > 一个</ live-example > 用于测试快速起步中的 `AppComponent` , < live-example name = "testing" plnkr = "banner-specs" > 另一个</ live-example > 用于测试“测试”章节的 `BannerComponent` 。
2018-03-07 03:48:44 -05:00
并在“测试”和“环境设置剖析”中链接到它们。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## Internationalization: pluralization and _select_ (2016-11-30)
2017-03-31 19:57:13 -04:00
2018-03-20 05:09:18 -04:00
## 国际化:单复数和 `select` (2016-11-30)
2017-07-22 23:51:25 -04:00
2018-03-03 08:06:01 -05:00
The [Internationalization (i18n) ](guide/i18n ) guide explains how to handle pluralization and
2017-02-22 13:09:39 -05:00
translation of alternative texts with `select` .
The sample demonstrates these features too.
2018-03-20 05:09:18 -04:00
[国际化 (i18n) ](guide/i18n )解释了如何处理单复数问题,和如何使用 `select` 来翻译候选内容。
2017-07-22 23:51:25 -04:00
例子中也演示了这些特性。
2017-02-22 13:09:39 -05:00
## Testing: karma file updates (2016-11-30)
2017-03-31 19:57:13 -04:00
2018-03-20 05:09:18 -04:00
## 测试:更新了 karma 文件 (2016-11-30)
2017-07-22 23:51:25 -04:00
2017-03-11 08:44:25 -05:00
* `karma.config` + `karma-test-shim` can handle multiple spec source paths;
see quickstart issue: [angular/quickstart#294 ](https://github.com/angular/quickstart/issues/294 ).
2018-03-03 08:06:01 -05:00
2018-03-20 05:09:18 -04:00
`karma.config` + `karma-test-shim` 可以处理多个测试源文件路径了,参见[angular/quickstart#294](https://github.com/angular/quickstart/issues/294)。
2017-07-22 23:51:25 -04:00
2017-03-11 08:44:25 -05:00
* Displays Jasmine Runner output in the karma-launched browser.
2017-02-22 13:09:39 -05:00
2018-03-20 05:09:18 -04:00
在启动了 karma 的浏览器中显示 Jasmine 的输出。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## QuickStart Rewrite (2016-11-18)
2017-03-31 19:57:13 -04:00
2017-08-06 19:49:44 -04:00
## 全新《快速上手》 (2016-11-18)
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
The QuickStart is completely rewritten so that it actually is quick.
It references a minimal "Hello Angular" app running in Plunker.
2017-03-11 10:36:40 -05:00
The new [Setup ](guide/setup ) page tells you how to install a local development environment
2017-02-22 13:09:39 -05:00
by downloading (or cloning) the QuickStart github repository.
You are no longer asked to copy-and-paste code into setup files that were not explained anyway.
2017-08-06 19:49:44 -04:00
完全重写了《快速上手》,变得更加快速。
2017-07-22 23:51:25 -04:00
它使用了在 Plunker 中运行的最小化的 “Hello Angular” 应用。
新添加的[搭建本地开发环境](guide/setup)页面解释了如何通过下载或者克隆 QuickStart github 库来安装本地开发环境。
你将不再需要拷贝粘贴代码到一些并没有对其解释的配置文件中。
2017-02-22 13:09:39 -05:00
## Sync with Angular v.2.2.0 (2016-11-14)
2017-03-31 19:57:13 -04:00
2018-03-20 05:09:18 -04:00
## 与 Angular v.2.2.0 同步(2016-11-14)
2017-07-22 23:51:25 -04:00
2018-03-03 08:06:01 -05:00
Docs and code samples updated and tested with Angular v.2.2.0.
2017-07-22 23:51:25 -04:00
2018-03-20 05:09:18 -04:00
使用 Angular v.2.2.0 更新和测试所有文档和代码例子。
2017-02-22 13:09:39 -05:00
## UPDATE: NgUpgrade Guide for the AOT friendly _upgrade/static_ module (2016-11-14)
2017-03-31 19:57:13 -04:00
2018-03-22 05:24:05 -04:00
## 更新:用于 AOT 的 *upgrade/static* 模块 NgUpgrade 指南 (2016-11-14)
2017-07-22 23:51:25 -04:00
2017-07-16 06:32:22 -04:00
The updated [NgUpgrade Guide ](guide/upgrade ) guide covers the
new AOT friendly `upgrade/static` module
2017-02-22 13:09:39 -05:00
released in v.2.2.0, which is the recommended
facility for migrating from AngularJS to Angular.
The documentation for the version prior to v.2.2.0 has been removed.
2018-03-21 04:23:00 -04:00
更新的[NgUpgrade 指南](guide/upgrade)涵盖在 v.2.2.0 发布的 AOT`upgrade/static` 模块,
2018-03-20 05:09:18 -04:00
是从 AngularJS 升级至 Angular 的推荐工具。
删除早于 v.2.2.0 版本的文档。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## ES6 described in "TypeScript to JavaScript" (2016-11-14)
2017-03-31 19:57:13 -04:00
2018-03-20 05:09:18 -04:00
## 在“从 TypeScript 到 JavaScript”增加 ES6 的描述 (2016-11-14)
2017-07-22 23:51:25 -04:00
2018-01-22 17:17:31 -05:00
The updated TypeScript to JavaScript guide explains how to write apps in ES6/7
2017-02-22 13:09:39 -05:00
by translating the common idioms in the TypeScript documentation examples
(and elsewhere on the web) to ES6/7 and ES5.
2018-03-20 05:09:18 -04:00
更新了“从 TypeScript 到 JavaScript”, 以解释如何使用 ES6/7 编写应用。
将 TypeScript 文档示例中(以及网站其它地方)的习惯用法翻译成 ES6/7 和 ES5。
2017-07-22 23:51:25 -04:00
2018-01-22 17:17:31 -05:00
This was [removed in August 2017 ](https://github.com/angular/angular/pull/18694 ) but can still be
viewed in the [v2 documentation ](https://v2.angular.io/docs/ts/latest/cookbook/ts-to-js.html ).
2018-03-20 05:09:18 -04:00
本章已经 [于 2017 年 8 月移除 ](https://github.com/angular/angular/pull/18694 ),
2018-03-07 03:48:44 -05:00
不过仍然可以在[第二版的文档中](https://v2.angular.io/docs/ts/latest/cookbook/ts-to-js.html)看到。
2017-02-22 13:09:39 -05:00
## Sync with Angular v.2.1.1 (2016-10-21)
2017-03-31 19:57:13 -04:00
2018-03-20 05:09:18 -04:00
## 与 Angular v.2.1.1 同步(2016-10-21)
2017-07-22 23:51:25 -04:00
2018-03-03 08:06:01 -05:00
Docs and code samples updated and tested with Angular v.2.1.1.
2017-07-22 23:51:25 -04:00
2018-03-20 05:09:18 -04:00
使用 Angular v.2.1.1 更新和测试所有文档和代码例子。
2017-02-22 13:09:39 -05:00
## npm _@types_ packages replace _typings_ (2016-10-20)
2017-03-31 19:57:13 -04:00
2018-03-22 05:24:05 -04:00
## 使用 npm 的_@types*包替换*typings_ (2016-10-20)
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
Documentation samples now get TypeScript type information for 3rd party libraries
from npm `@types` packages rather than with the _typings_ tooling.
The `typings.json` file is gone.
2018-03-20 05:09:18 -04:00
文档例子现在从 npm 的 `@types` 第三方库获取 TypeScript 类型信息, 不再使用_typings_。
删除 `typings.json` 文件。
2017-07-22 23:51:25 -04:00
2017-03-11 10:36:40 -05:00
The [AngularJS Upgrade ](guide/upgrade ) guide reflects this change.
2017-02-22 13:09:39 -05:00
The `package.json` installs `@types/angular` and several `@types/angular-...`
packages in support of upgrade; these are not needed for pure Angular development.
2018-03-20 05:09:18 -04:00
"[从 AngularJS 升级](guide/upgrade)"指南反映了这个变化。
`package.json` 安装 `@types/angular` 和一些 `@types/angular-...` 包来支持升级。它们在纯 Angular 开发中是不需要的。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## "Template Syntax" explains two-way data binding syntax (2016-10-20)
2017-03-31 19:57:13 -04:00
2017-07-22 23:51:25 -04:00
## "模板语法"添加了双向数据绑定语法的解释(2016-10-20)
2017-02-22 13:09:39 -05:00
Demonstrates how to two-way data bind to a custom Angular component and
re-explains `[(ngModel)]` in terms of the basic `[()]` syntax.
2018-03-20 05:09:18 -04:00
展示了如何在自定义 Angular 组件中双向数据绑定,用基础 `[()]` 重新解释 `[(ngModel)]` 。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## BREAKING CHANGE: `in-memory-web-api` (v.0.1.11) delivered as esm umd (2016-10-19)
2017-03-31 19:57:13 -04:00
2018-03-20 05:09:18 -04:00
## 破坏性变化:`in-memory-web-api` (v.0.1.11) 以 esm umd 的形式发布 (2016-10-19)
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
This change supports ES6 developers and aligns better with typical Angular libraries.
It does not affect the module's API but it does affect how you load and import it.
2017-04-24 14:23:45 -04:00
See the < a href = "https://github.com/angular/in-memory-web-api/blob/master/CHANGELOG.md#0113-2016-10-20" > change note< / a >
2017-02-22 13:09:39 -05:00
in the `in-memory-web-api` repo.
2018-03-20 05:09:18 -04:00
这个变化支持 ES6 开发者,并与典型的 Angular 库看齐。
它不会影响模块的 API, 但是它改变了加载和导入它的方式。
参见 `in-memory-web-api` 库的< a href = "https://github.com/angular/in-memory-web-api/blob/master/CHANGELOG.md#0113-2016-10-20" target = "_blank" > 变更记录</ a > 。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## "Router" _preload_ syntax and _:enter_/_:leave_ animations (2016-10-19)
2017-03-31 19:57:13 -04:00
2018-03-22 05:24:05 -04:00
## "路由器"*预加载*语法和 *:enter*/*:leave* 动画(2016-10-19)
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
The router can lazily _preload_ modules _after_ the app starts and
_before_ the user navigates to them for improved perceived performance.
2018-03-22 05:24:05 -04:00
路由器可以在应用启动*之后*和用户导航到惰性加载模块*之前*,预先加载惰性模块,以增强性能。
2017-07-22 23:51:25 -04:00
New `:enter` and `:leave` aliases make animation more natural.
2018-03-20 05:09:18 -04:00
新 `:enter` 和 `:leave` 语法,让动画更加自然。
2017-02-22 13:09:39 -05:00
## Sync with Angular v.2.1.0 (2016-10-12)
2017-03-31 19:57:13 -04:00
2018-03-20 05:09:18 -04:00
## 与 Angular v.2.1.0 同步(2016-10-12)
2017-07-22 23:51:25 -04:00
2018-03-03 08:06:01 -05:00
Docs and code samples updated and tested with Angular v.2.1.0.
2017-07-22 23:51:25 -04:00
2018-03-20 05:09:18 -04:00
使用 Angular v.2.1.0 更新和测试所有文档和代码例子。
2017-02-22 13:09:39 -05:00
2017-04-30 16:10:32 -04:00
## NEW "Ahead of time (AOT) Compilation" guide (2016-10-11)
2017-03-31 19:57:13 -04:00
2018-03-22 05:30:09 -04:00
## 添加了新的“预编译(AOT)" 指南(2016-10-11)
2017-07-22 23:51:25 -04:00
2017-04-30 16:10:32 -04:00
The NEW [Ahead of time (AOT) Compilation ](guide/aot-compiler ) guide
2017-02-22 13:09:39 -05:00
explains what AOT compilation is and why you'd want it.
It demonstrates the basics with a QuickStart app
followed by the more advanced considerations of compiling and bundling the Tour of Heroes.
2018-03-22 05:30:09 -04:00
全新[预编译(AOT)](guide/aot-compiler)指南介绍了什么是 AOT 编译和为何你需要它。
2017-08-06 19:49:44 -04:00
它以**快速上手**应用程序开始讲解,接着介绍了编译和构建**英雄指南**的更高级的注意事项。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## Sync with Angular v.2.0.2 (2016-10-6)
2017-03-31 19:57:13 -04:00
2018-03-20 05:09:18 -04:00
## 与 Angular v.2.0.2 同步 (2016-10-6)
2017-07-22 23:51:25 -04:00
2018-03-03 08:06:01 -05:00
Docs and code samples updated and tested with Angular v.2.0.2.
2017-07-22 23:51:25 -04:00
2018-03-20 05:09:18 -04:00
使用 Angular v.2.0.2 更新和测试所有文档和代码例子。
2017-02-22 13:09:39 -05:00
## "Routing and Navigation" guide with the _Router Module_ (2016-10-5)
2017-03-31 19:57:13 -04:00
2017-07-22 23:51:25 -04:00
## 在“路由和导航”向导中添加**路由模块** (2016-10-5)
2017-03-11 10:36:40 -05:00
The [Routing and Navigation ](guide/router ) guide now locates route configuration
2017-07-16 06:32:22 -04:00
in a _Routing Module_ .
2017-02-22 13:09:39 -05:00
The _Routing Module_ replaces the previous _routing object_ involving the `ModuleWithProviders` .
2017-07-22 23:51:25 -04:00
[Routing and Navigation ](guide/router )现在在**路由模块**中设置路由配置。
2018-03-20 05:09:18 -04:00
**路由模块**替换之前的**路由对象**,使用了 `ModuleWithProviders` 。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
All guided samples with routing use the _Routing Module_ and prose content has been updated,
2017-07-16 06:32:22 -04:00
most conspicuously in the
2017-07-04 10:58:20 -04:00
[NgModule ](guide/ngmodules ) guide and [NgModule FAQ ](guide/ngmodule-faq ) guide.
2017-02-22 13:09:39 -05:00
2018-03-22 05:30:09 -04:00
所有使用路由的例子都使用**路由模块**,相关内容也被更新。更新最多的是[Angular 模块( NgModule) ](guide/ngmodules)章和[Angular 模块常见问题](guide/ngmodule-faq)指南。
2017-07-22 23:51:25 -04:00
2017-04-30 16:10:32 -04:00
## New "Internationalization" guide (2016-09-30)
2017-02-22 13:09:39 -05:00
2018-03-22 05:30:09 -04:00
## 全新“国际化”指南(2016-09-30)
2017-07-22 23:51:25 -04:00
2017-04-30 16:10:32 -04:00
Added a new [Internationalization (i18n) ](guide/i18n ) guide that shows how
2017-02-22 13:09:39 -05:00
to use Angular "i18n" facilities to translate template text into multiple languages.
2018-03-22 05:30:09 -04:00
添加了新的[国际化(i18n)](guide/i18n)指南,展示了如何使用 Angular 的“i18n”工具来讲模板文本翻译到多种语言。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## "angular-in-memory-web-api" package rename (2016-09-27)
2017-07-22 23:51:25 -04:00
## 重命名“angular-in-memory-web-api”包(2016-09-27)
2017-02-22 13:09:39 -05:00
Many samples use the `angular-in-memory-web-api` to simulate a remote server.
This library is also useful to you during early development before you have a server to talk to.
2018-03-20 05:09:18 -04:00
许多例子使用了 `angular-in-memory-web-api` 来模拟远程服务器。
2017-07-22 23:51:25 -04:00
这个库在你拥有服务器之前的早期开发阶段也很有用。
2017-02-22 13:09:39 -05:00
The package name was changed from "angular2-in-memory-web-api" which is still frozen-in-time on npm.
2017-07-16 06:32:22 -04:00
The new "angular-in-memory-web-api" has new features.
2017-04-24 14:23:45 -04:00
< a href = "https://github.com/angular/in-memory-web-api/blob/master/README.md" > Read about them on github< / a > .
2017-02-22 13:09:39 -05:00
2017-07-22 23:51:25 -04:00
这个包的名字从“angular2-in-memory-web-api”( 仍然有效, 但不再更新了) 重新命名了。
新的“angular-in-memory-web-api”有新的功能。
2018-03-20 05:09:18 -04:00
< a href = "https://github.com/angular/in-memory-web-api/blob/master/README.md" target = "_blank" > 到 github 获得更多详情< / a > .
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## "Style Guide" with _NgModules_ (2016-09-27)
2017-07-22 23:51:25 -04:00
## “风格指南”中添加了_NgModules_(2016-09-27)
2017-07-11 18:05:20 -04:00
[StyleGuide ](guide/styleguide ) explains recommended conventions for NgModules.
2017-02-22 13:09:39 -05:00
Barrels now are far less useful and have been removed from the style guide;
they remain valuable but are not a matter of Angular style.
2017-03-11 08:44:25 -05:00
Also relaxed the rule that discouraged use of the `@Component.host` property.
2017-02-22 13:09:39 -05:00
2018-03-22 05:18:48 -04:00
[StyleGuide ](guide/styleguide )解释了 Angular 模块( NgModule) 推荐的约定。
2017-07-22 23:51:25 -04:00
现在,封装桶不再那么重要,风格指南已经移除了它们。
2018-03-20 05:09:18 -04:00
它们仍然很有价值,但是它们与 Angular 风格无关。
2018-03-22 05:18:48 -04:00
同时,**不推荐使用 `@Component.host` 属性**的规则也有所放宽。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## _moduleId: module.id_ everywhere (2016-09-25)
2018-03-20 05:09:18 -04:00
## moduleId: 到处添加 module.id(2016-09-25)
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
Sample components that get their templates or styles with `templateUrl` or `styleUrls`
have been converted to _module-relative_ URLs.
2017-03-11 08:44:25 -05:00
Added the `moduleId: module.id` property-and-value to their `@Component` metadata.
2017-02-22 13:09:39 -05:00
2018-03-20 05:09:18 -04:00
在所有使用 `templateUrl` 或者 `styleUrls` 来获取模板或样式的例子组件都被转换为**相对模块**的 URL。
2018-03-22 05:18:48 -04:00
把 `moduleId: module.id` 添加到了它们的 `@Component` 元数据。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
This change is a requirement for compilation with AOT compiler when the app loads
modules with SystemJS as the samples currently do.
2018-03-21 04:23:00 -04:00
当应用像例子当前使用的方法一样 - 使用 SystemJS 加载模块时,本更新是 AOT 编译器的前提条件。
2017-07-22 23:51:25 -04:00
2017-02-22 13:09:39 -05:00
## "Lifecycle Hooks" guide simplified (2016-09-24)
2017-07-22 23:51:25 -04:00
## 简化了“生命周期钩子”章(2016-09-24)
The [Lifecycle Hooks ](guide/lifecycle-hooks ) guide is shorter, simpler, and
draws more attention to the order in which Angular calls the hooks.
2018-03-20 05:09:18 -04:00
[生命周期钩子 ](guide/lifecycle-hooks )章现在更加简短,并且对强调了 Angular 是以什么顺序来调用钩子方法的。