Solution Review: Spinning Animation
Explore how to build a spinning animation in Angular by toggling CSS classes, handling animation events, and defining keyframe rotations. This lesson helps you understand how to trigger and control animations effectively in a reusable and interactive way.
In the previous challenge, you were asked to create a rotation animation which could be triggered multiple times when the target element was clicked.
Step 1: Add a flag and a function to start and stop spinning
Create a variable, isSpinning,to trigger the spin animation (line 11). We can then add the functions startSpinning ...