From the course: Angular: Animations
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Using Stagger within an animation - Angular Tutorial
From the course: Angular: Animations
Using Stagger within an animation
- [Instructor] Stagger works alongside query in order to animate the selected elements individually one after the other using a delay in between each segment of an animation. This allows a much more dynamic animation as each element is rendered separately instead of everything at once. There actually isn't a whole lot to do to get this working. We need to add stagger to our imports and then just adjust our query. So here we have our present query. Let's remove that and paste in a snippet for the new query. You can see that almost all of it looks exactly the same. We just have this extra piece here defining our stagger. We're setting stagger to 100 milliseconds. So what should happen is that between each single block being animated should be a staggered delay of 100 milliseconds. To see this in action, save your file. It'll recompile, and then we'll pop over to the browser to check it out. All right, going to advanced, we can see our fade block fade out, and now when we show spoons, we…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Self-contained component animation6m 43s
-
(Locked)
Writing reusable animations5m 25s
-
(Locked)
Animation input parameters3m 58s
-
(Locked)
Configuring router animation6m 53s
-
(Locked)
Selecting items with a query6m 20s
-
(Locked)
Using Stagger within an animation1m 37s
-
(Locked)
Challenge: Per-page router animations23s
-
(Locked)
Solution: Per-page router animations2m 1s
-
(Locked)
-
-
-