Bird
0
0

Analyze this Angular animation trigger:

medium📝 component behavior Q5 of 15
Angular - Animations
Analyze this Angular animation trigger:
trigger('visibility', [
  state('shown', style({ opacity: 1, height: '*' })),
  state('hidden', style({ opacity: 0, height: '0px' })),
  transition('hidden => shown', animate('150ms ease-in')),
  transition('shown => hidden', animate('300ms ease-out'))
])

What is the animation duration when transitioning from 'shown' to 'hidden'?
A150 milliseconds
B300 milliseconds
C450 milliseconds
DNo animation occurs
Step-by-Step Solution
Solution:
  1. Step 1: Identify transition direction

    Transition is from 'shown' to 'hidden'.
  2. Step 2: Locate matching transition

    transition('shown => hidden', animate('300ms ease-out')) matches.
  3. Step 3: Extract duration

    Duration specified is 300ms.
  4. Final Answer:

    300 milliseconds -> Option B
  5. Quick Check:

    Check transition arrow and duration value [OK]
Quick Trick: Check transition arrow for correct duration [OK]
Common Mistakes:
  • Mixing up durations for opposite transitions
  • Assuming durations add up
  • Ignoring ease-in vs ease-out

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes