From the course: Angular: Animations
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Selecting items with a query - Angular Tutorial
From the course: Angular: Animations
Selecting items with a query
- [Instructor] The query function is used alongside an animation, to specify multiple elements within the current element, which should be animated together. We can render a large amount of elements and fade them all in using the query function. The first thing we'll need to do is actually import some of our animation data that we'll need. So you can see here we're importing trigger, state style, animate, and transition, which is normal, but we also are importing query. What we're going to do is create a bunch of blocks to represent certain objects, these objects are going to be spoons, because there are a number of different spoons in the world, and what we'll do is paste in a style for our spoon block here, within our styles data. And it basically just creates a nice little block for us here with certain background colors, and border radius and so forth. The next thing to do is actually go down into our class definition for advanced component, and paste in an array of spoon names…
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
-
-
-
-
-
-
Self-contained component animation6m 43s
-
Writing reusable animations5m 25s
-
Animation input parameters3m 58s
-
Configuring router animation6m 53s
-
Selecting items with a query6m 20s
-
Using Stagger within an animation1m 37s
-
Challenge: Per-page router animations23s
-
Solution: Per-page router animations2m 1s
-
-
-
-