Bird
0
0

You want to create a feature module FeatureModule and use it in your root AppModule. Which is the correct way to include it?

hard📝 Conceptual Q8 of 15
Angular - Modules
You want to create a feature module FeatureModule and use it in your root AppModule. Which is the correct way to include it?
AAdd <code>FeatureModule</code> to the <code>imports</code> array of <code>AppModule</code>.
BAdd <code>FeatureModule</code> to the <code>declarations</code> array of <code>AppModule</code>.
CAdd <code>FeatureModule</code> to the <code>providers</code> array of <code>AppModule</code>.
DAdd <code>FeatureModule</code> to the <code>bootstrap</code> array of <code>AppModule</code>.
Step-by-Step Solution
Solution:
  1. Step 1: Understand how to use feature modules

    Feature modules are imported into other modules via the imports array.
  2. Step 2: Check correct placement of FeatureModule

    It should be listed in imports of AppModule to use its exported components and services.
  3. Final Answer:

    Add FeatureModule to the imports array of AppModule. -> Option A
  4. Quick Check:

    Feature modules go in imports [OK]
Quick Trick: Import feature modules in imports array [OK]
Common Mistakes:
  • Adding modules to declarations
  • Putting modules in providers
  • Trying to bootstrap a module

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes