Bird
0
0

Which of the following is the correct syntax to define keyframes in Angular animations?

easy📝 Syntax Q3 of 15
Angular - Animations
Which of the following is the correct syntax to define keyframes in Angular animations?
Akeyframe([style({opacity: 0}), style({opacity: 1})])
Bkeyframe({opacity: 0}, {opacity: 1})
Ckeyframes({opacity: 0}, {opacity: 1})
Dkeyframes([style({opacity: 0}), style({opacity: 1})])
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct function and parameter format

    The keyframes function takes an array of style() objects to define animation steps.
  2. Step 2: Check each option's syntax

    Only keyframes([style({opacity: 0}), style({opacity: 1})]) uses keyframes with an array of style() calls correctly.
  3. Final Answer:

    keyframes([style({opacity: 0}), style({opacity: 1})]) -> Option D
  4. Quick Check:

    Correct keyframes syntax = keyframes([style({opacity: 0}), style({opacity: 1})]) [OK]
Quick Trick: Use keyframes with an array of style() calls [OK]
Common Mistakes:
  • Using singular 'keyframe' instead of 'keyframes'
  • Passing objects directly instead of style()
  • Not wrapping styles in an array

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes