Bird
0
0

Why does this animation code cause an error?

medium📝 Debug Q7 of 15
Angular - Animations
Why does this animation code cause an error?
animate('500ms', style({ opacity: 1 }), 'ease-in')
Astyle cannot be used inside animate
BEasing must come before duration
CDuration cannot be less than 1s
Danimate accepts only two arguments, not three
Step-by-Step Solution
Solution:
  1. Step 1: Review animate method signature

    animate accepts either one string argument or two arguments (timing string and style).
  2. Step 2: Check argument count in code

    The code passes three arguments, which is invalid.
  3. Final Answer:

    animate accepts only two arguments, not three -> Option D
  4. Quick Check:

    Animate max two arguments: timing and style [OK]
Quick Trick: Animate takes max two arguments: timing string and style [OK]
Common Mistakes:
  • Passing three arguments to animate
  • Misordering easing and duration
  • Thinking style is disallowed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes