Bird
0
0

Given the following Angular animation trigger:

medium📝 query result Q13 of 15
Angular - Animations
Given the following Angular animation trigger:
trigger('openClose', [
  state('open', style({ height: '200px', opacity: 1 })),
  state('closed', style({ height: '100px', opacity: 0.5 })),
  transition('open => closed', animate('1s')),
  transition('closed => open', animate('0.5s'))
])

What will be the animation duration when transitioning from closed to open?
ANo animation
B1 second
C0.5 seconds
D2 seconds
Step-by-Step Solution
Solution:
  1. Step 1: Identify the transition direction

    The transition from 'closed' to 'open' is defined as transition('closed => open', animate('0.5s')).
  2. Step 2: Read the animation duration

    The animate function specifies 0.5 seconds duration for this transition.
  3. Final Answer:

    0.5 seconds -> Option C
  4. Quick Check:

    closed to open = 0.5s animation [OK]
Quick Trick: Check transition direction and matching animate duration [OK]
Common Mistakes:
  • Mixing up open=>closed and closed=>open durations
  • Assuming default duration if not specified
  • Ignoring transition direction syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes