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

Selecting items with a query - Angular Tutorial

From the course: Angular: Animations

Start my 1-month free trial

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…

Contents