Bird
0
0

You added BrowserAnimationsModule to your Angular app but animations still don't work. Which of these is the MOST likely cause?

medium📝 Debug Q14 of 15
Angular - Animations
You added BrowserAnimationsModule to your Angular app but animations still don't work. Which of these is the MOST likely cause?
AYou imported <code>BrowserAnimationsModule</code> but did not import <code>BrowserModule</code>
BYou used <code>BrowserAnimationsModule</code> in a feature module instead of the root module
CYou forgot to add <code>BrowserAnimationsModule</code> to the <code>imports</code> array in your root module
DYou did not add <code>animations</code> property in <code>angular.json</code>
Step-by-Step Solution
Solution:
  1. Step 1: Check common setup mistakes

    Importing the module is not enough; it must be added to the root module's imports array.
  2. Step 2: Evaluate other options

    BrowserModule is usually imported; feature module import is allowed but root is best; no animations property needed in angular.json.
  3. Final Answer:

    You forgot to add BrowserAnimationsModule to the imports array in your root module -> Option C
  4. Quick Check:

    Module must be in imports array to enable animations [OK]
Quick Trick: Add BrowserAnimationsModule to imports array in root module [OK]
Common Mistakes:
  • Importing but not adding to imports array
  • Confusing feature module import with root module import
  • Thinking angular.json needs animation config

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes