The query function is used alongside an animation to specify multiple elements within the current element which should be animated together. You can render a large amount of elements and fade them all in using the query() function. While query() has been used to target a lot of child elements within a component—you can also select specific single elements for animation as well.
- [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.…
So this is a snippet you can find in the snippets file,…
- Installing the Angular CLI
- Creating a new project
- Verifying the animations package
- Configuring project routes
- Animating components
- Triggering animation between states
- Stepped and parallel animation
- Writing reusable animations
- Animating individual items with query and stagger
- Animating an existing Angular project
Skill Level Intermediate
1. Getting Ready to Animate
2. Enabling Angular Animations
3. Angular Animation Basics
4. Advanced Angular Animation
5. Animating an Existing Interface
6. Package for Distribution
Building the project1m 56s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.