diff --git a/aio/content/guide/animations.md b/aio/content/guide/animations.md index e822e42b3f..9eee85859e 100644 --- a/aio/content/guide/animations.md +++ b/aio/content/guide/animations.md @@ -33,6 +33,9 @@ keyframes as a fallback instead (automatically). This means that the polyfill is code uses [AnimationBuilder](/api/animations/AnimationBuilder). If your code does use AnimationBuilder, then uncomment the `web-animations-js` polyfill from the `polyfills.ts` file generated by Angular CLI. +对于 Angular 6,如果浏览器没有提供对 Web 动画 API 的原生支持,Angular 就会自动改用 CSS 的关键帧动画作为后备实现。这意味,除非要在代码中使用 [AnimationBuilder](/api/animations/AnimationBuilder) ,否则不必使用相关的腻子脚本。 +如果你要在代码中使用 AnimationBuilder ,就要从 Angular CLI 自动生成的 `polyfills.ts` 文件中反注释掉 `web-animations-js` 腻子脚本。 +
@@ -50,21 +53,32 @@ The examples in this page are available as a . Before you can add animations to your application, you need to import a few animation-specific modules and functions to the root application module. +在往应用中添加动画之前,你要首先在应用的根模块中引入一些与动画有关的模块和函数。 + #### Example basics +#### 基本例子 + The animations examples in this guide animate a list of heroes. +这里的动画例子用来给英雄列表添加动画。 + A `Hero` class has a `name` property, a `state` property that indicates if the hero is active or not, and a `toggleState()` method to switch between the states. +`Hero` 类有一个 `name` 属性、一个 `state` 属性(用于表明该英雄是否为激活状态)和一个 `toggleState()` 函数,用来在这两种状态之间切换。 + Across the top of the screen (`app.hero-team-builder.component.ts`) are a series of buttons that add and remove heroes from the list (via the `HeroService`). The buttons trigger changes to the list that all of the example components see at the same time. +在屏幕的顶部(`app.hero-team-builder.component.ts`)是一系列按钮,用于从列表中添加和删除英雄(通过 `HeroService`)。 +这些按钮会引起列表的变化,同时可以看到列表中的所有范例组件。 + {@a example-transitioning-between-states} ## Transitioning between two states diff --git a/aio/content/guide/pipes.md b/aio/content/guide/pipes.md index 76f65a681e..df7848e352 100644 --- a/aio/content/guide/pipes.md +++ b/aio/content/guide/pipes.md @@ -326,6 +326,8 @@ Angular通过*变更检测*过程来查找绑定值的更改,并在每一次Ja Angular picks a simpler, faster change detection algorithm when you use a pipe. +当使用管道时,Angular 会选用一种更简单、更快速的变更检测算法。 +

No pipe

无管道

diff --git a/aio/content/guide/structural-directives.md b/aio/content/guide/structural-directives.md index 07f0f516ff..8bcff98389 100644 --- a/aio/content/guide/structural-directives.md +++ b/aio/content/guide/structural-directives.md @@ -977,5 +977,4 @@ You learned * to write a [custom structural directive](guide/structural-directives#unless), `UnlessDirective`. - 写了一个[自定义结构型指令](guide/structural-directives#unless) —— `UnlessDirective`。