Bird
0
0

Identify the error in this Angular animation code:

medium📝 Debug Q6 of 15
Angular - Animations
Identify the error in this Angular animation code:
trigger('zoom', [transition(':enter', [animate('200ms', style({transform: 'scale(1)'}))])])
AMissing initial style before animate to scale(1)
BIncorrect use of transition keyword
Canimate() cannot be used inside transition
DStyle object must not contain transform property
Step-by-Step Solution
Solution:
  1. Step 1: Check animation start and end states

    Animation should define initial style before animating to scale(1).
  2. Step 2: Verify if initial style is missing

    Code lacks style({transform: 'scale(0)'}) or similar before animate.
  3. Final Answer:

    Missing initial style before animate to scale(1) -> Option A
  4. Quick Check:

    Initial style needed before animate = A [OK]
Quick Trick: Always set initial style before animate() [OK]
Common Mistakes:
  • Skipping initial style causes no visible animation
  • Misusing transition syntax
  • Thinking animate() is invalid inside transition

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes