Bird
0
0

Given this feature module code snippet, what will be the output when DashboardComponent is used?

medium📝 component behavior Q4 of 15
Angular - Modules
Given this feature module code snippet, what will be the output when DashboardComponent is used?
@NgModule({
  declarations: [DashboardComponent],
  exports: [DashboardComponent]
})
export class DashboardModule {}
ADashboardComponent can be used in other modules that import DashboardModule
BDashboardComponent is private and cannot be used outside DashboardModule
CDashboardComponent will cause a runtime error if used outside DashboardModule
DDashboardComponent is automatically bootstrapped
Step-by-Step Solution
Solution:
  1. Step 1: Analyze exports array

    DashboardComponent is declared and exported, so it is visible outside the module.
  2. Step 2: Understand usage in other modules

    Other modules importing DashboardModule can use DashboardComponent without error.
  3. Final Answer:

    DashboardComponent can be used in other modules that import DashboardModule -> Option A
  4. Quick Check:

    Exported components are usable outside = B [OK]
Quick Trick: Export components to share them outside the module [OK]
Common Mistakes:
  • Assuming declared components are always private
  • Forgetting to export components to share
  • Confusing exports with bootstrap

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes