Bird
0
0

Which of the following is the correct syntax to define a transition from state 'open' to 'closed' in Angular animations?

easy📝 Syntax Q12 of 15
Angular - Animations
Which of the following is the correct syntax to define a transition from state 'open' to 'closed' in Angular animations?
Atransition('open => closed', [animate('500ms')])
Btransition(open to closed, animate(500ms))
Ctransition('open - closed', animate('500'))
Dtransition('open > closed', [animate('500ms')])
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular transition syntax

    Transitions use string format with arrow '=>' between states and an array of animation steps.
  2. Step 2: Match correct syntax

    transition('open => closed', [animate('500ms')]) uses correct arrow '=>' and wraps animation in an array with timing string '500ms'.
  3. Final Answer:

    transition('open => closed', [animate('500ms')]) -> Option A
  4. Quick Check:

    Correct arrow and array syntax = A [OK]
Quick Trick: Use 'state1 => state2' with array for animations [OK]
Common Mistakes:
  • Using wrong arrow symbols like 'to' or '-'
  • Not wrapping animate() in an array
  • Missing quotes around states

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes