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.
Animation callback functions - Angular Tutorial
From the course: Angular: Animations
Animation callback functions
- [Instructor] Angular allows us to take advantage of animation events, broadcast when an animation begins and ends. We can make use of this functionality via animation callbacks. In addition to monitoring the phaseName, triggerName, fromState, and toState involved, we are also provided the totalTime, defining the actual time of the animation in question. So, to do this, make sure you're in the AnimboxComponent because these properties are defined in the component where the animations are actually taking place and I'm going to paste in a few attributes here. So, right after our information about our changeState, we're going to set changeState.start and set that equal to a method called animationBegin, passing in the event that takes place here. We'll also have one changeState.done. Here, we'll pass that through the function called animationEnd and once again pass in the event itself. Let's go ahead and define those functions now. What we'll do is scroll down, right below input inside…
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
-
-
-
-
-
Preparing component interaction3m 1s
-
(Locked)
Establishing stateful data3m 15s
-
(Locked)
Triggering animation between states6m 22s
-
(Locked)
Delay and easing functions5m 24s
-
(Locked)
Stepped animation with keyframes4m 24s
-
(Locked)
Parallel animation with groups3m 15s
-
(Locked)
Animation callback functions4m 31s
-
(Locked)
Challenge: Clear the message text24s
-
(Locked)
Solution: Clear the message text1m 15s
-
-
-
-
-