Bird
0
0

If a shared module imports CommonModule and exports it, what effect does this have on modules importing the shared module?

medium📝 Predict Output Q5 of 15
Angular - Modules
If a shared module imports CommonModule and exports it, what effect does this have on modules importing the shared module?
AThey get duplicate CommonModule instances causing errors
BThey must still import CommonModule separately
CThey can use common directives like *ngIf and *ngFor without importing CommonModule again
DCommonModule features are not available to importing modules
Step-by-Step Solution
Solution:
  1. Step 1: Understand CommonModule role

    CommonModule provides common directives like *ngIf and *ngFor.
  2. Step 2: Effect of exporting CommonModule

    If a shared module exports CommonModule, importing modules get access to those directives automatically.
  3. Final Answer:

    They can use common directives like *ngIf and *ngFor without importing CommonModule again -> Option C
  4. Quick Check:

    Exporting CommonModule shares its directives [OK]
Quick Trick: Export CommonModule to share common directives [OK]
Common Mistakes:
  • Forgetting to export CommonModule
  • Importing CommonModule multiple times unnecessarily
  • Assuming directives are unavailable without direct import

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes