Bird
0
0

Find the mistake in this animation trigger:

medium📝 Debug Q7 of 15
Angular - Animations
Find the mistake in this animation trigger:
trigger('zoom', [
  state('small', style({ transform: 'scale(0.5)' })),
  state('large', style({ transform: 'scale(1.5)' })),
  transition('small => large', animate(300))
])
AThe animate function requires a string duration like '300ms' not a number
BThe state names must be numbers
CThe transform property cannot use scale()
DThe trigger name cannot be 'zoom'
Step-by-Step Solution
Solution:
  1. Step 1: Check animate function parameter

    Animate expects a string with units like '300ms', not a number. State names can be strings, transform supports scale(), and trigger names can be any string.
  2. Final Answer:

    The animate function requires a string duration like '300ms' not a number -> Option A
  3. Quick Check:

    Animate duration must be string with units [OK]
Quick Trick: Always use string with units in animate() [OK]
Common Mistakes:
  • Passing number instead of string to animate
  • Thinking state names must be numeric
  • Misunderstanding CSS transform usage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes