You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
Here, the animation trigger applies to every element repeated by an `ngFor`. Each of
76
76
the repeated elements animates independently. The value of the
77
-
attribute is bound to the expression `hero.state`. It is always either `inactive`
78
-
or `active`.
77
+
attribute is bound to the expression `hero.state` and is always either `active`/`inactive`.
79
78
80
79
With this setup, an animated transition appears whenever a hero object changes state.
81
80
Here's the full component implementation:
@@ -148,10 +147,10 @@ figure.image-display
148
147
:marked
149
148
### The `void` state
150
149
151
-
The special state, called `void`, can apply to any animation. It applies
150
+
The special state called `void` can apply to any animation. It applies
152
151
when the element is *not* attached to a view, perhaps because it has not yet been
153
-
added or because it has been removed. The `void` state is useful for defining "enter" and
154
-
"leave" animations.
152
+
added or because it has been removed. The `void` state is useful for defining enter and
153
+
leave animations.
155
154
156
155
For example the `* => void` transition applies when the element leaves the view,
157
156
regardless of what state it was in before it left.
@@ -189,10 +188,10 @@ figure
189
188
different transitions for entering and leaving based on what the state of the hero
190
189
is:
191
190
192
-
* Inactive hero enter: `void => inactive`.
193
-
* Active hero enter: `void => active`.
194
-
* Inactive hero leave: `inactive => void`.
195
-
* Active hero leave: `active => void`.
191
+
* Inactive hero enter: `void => inactive`
192
+
* Active hero enter: `void => active`
193
+
* Inactive hero leave: `inactive => void`
194
+
* Active hero leave: `active => void`
196
195
197
196
This gives you fine-grained control over each transition:
198
197
@@ -211,30 +210,30 @@ figure.image-display
211
210
[a list of animatable properties](https://www.w3.org/TR/css3-transitions/#animatable-properties)
212
211
on its [CSS Transitions page](https://www.w3.org/TR/css3-transitions).
213
212
214
-
For positional properties that have a numeric value, define a unit by providing
213
+
For positional properties that have a numeric value, you can define a unit by providing
215
214
the value as a string with the appropriate suffix:
216
215
217
216
* `'50px'`
218
217
* `'3em'`
219
218
* `'100%'`
220
219
221
-
Define most dimensional properties as a number in pixels:
220
+
If you don't provide a unit when specifying dimension, Angular will assume the default of `px`:
222
221
223
222
* `50` is the same as saying `'50px'`
224
223
225
224
## Automatic property calculation
226
225
figure
227
226
img(src="/resources/images/devguide/animations/animation_auto.gif"alt="Animation with automated height calculation"align="right"style="width:220px;margin-left:20px")
228
227
:marked
229
-
Sometimes your app doesn't know the value of a dimensional style property until runtime.
230
-
For example, it is quite common for elements to have widths and heights that
228
+
Sometimes you don't know the value of a dimensional style property until runtime.
229
+
For example, elements often have widths and heights that
231
230
depend on their content and the screen size. These properties are often tricky
232
231
to animate with CSS.
233
232
234
233
In these cases, you can use a special `*` property value so that the value of the
235
234
property is computed at runtime and then plugged into the animation.
236
235
237
-
In this example, the "leave" animation takes whatever height the element has before it
236
+
In this example, the leave animation takes whatever height the element has before it
There are three timing properties you can tune for every animated transition:
246
245
the duration, the delay, and the easing function. They are all combined into
247
-
a single transition, *timing string*.
246
+
a single transition *timing string*.
248
247
249
248
### Duration
250
249
@@ -267,7 +266,7 @@ figure
267
266
268
267
The [easing function](http://easings.net/) controls how the animation accelerates
269
268
and decelerates during its runtime. For example, an `ease-in` function causes
270
-
the animation to begin relatively slowly and picks up speed as it progresses. You
269
+
the animation to begin relatively slowly but pick up speed as it progresses. You
271
270
can control the easing by adding it as a *third* value in the string after the duration
272
271
and the delay (or as the *second* value when there is no delay):
273
272
@@ -279,7 +278,7 @@ figure
279
278
:marked
280
279
### Example
281
280
282
-
Here are a couple of custom timings in action. Both "enter" and "leave" last for
281
+
Here are a couple of custom timings in action. Both enter and leave last for
283
282
200 milliseconds but they have different easings. The leave begins after a
284
283
slight delay:
285
284
@@ -294,7 +293,7 @@ figure
294
293
that goes through one or more intermediate styles when transitioning between two sets of styles.
295
294
296
295
For each keyframe, you specify an *offset* that defines at which point
297
-
in the animation keyframe applies. The offset is a number between zero,
296
+
in the animation that keyframe applies. The offset is a number between zero,
298
297
which marks the beginning of the animation, and one, which marks the end.
299
298
300
299
This example adds some "bounce" to the enter and leave animations with
@@ -316,16 +315,16 @@ figure
316
315
figure
317
316
img(src="/resources/images/devguide/animations/animation_groups.gif"alt="Parallel animations with different timings, implemented with groups"align="right"style="width:220px;margin-left:20px")
318
317
:marked
319
-
You've seen how you to animate multiple style properties at the same time:
318
+
You've seen how to animate multiple style properties at the same time:
320
319
just put all of them into the same `style()` definition.
321
320
322
321
But you may also want to configure different *timings* for animations that happen
323
322
in parallel. For example, you may want to animate two CSS properties but use a
324
323
different easing function for each one.
325
324
326
325
For this you can use animation *groups*. In this example, using groups both on
327
-
enter and leave allow for two different timing configurations. Both
328
-
are applied to the same element in parallel, but run independent of each other:
326
+
enter and leave allows for two different timing configurations. Both
327
+
are applied to the same element in parallel, but run independently of each other:
0 commit comments