Bird
0
0

What is wrong with this feature module import?

medium📝 Debug Q7 of 15
Angular - Modules
What is wrong with this feature module import?
import { NgModule } from '@angular/core';
import { SharedModule } from './shared/shared.module';

@NgModule({
  imports: SharedModule,
  declarations: [ProfileComponent]
})
export class ProfileModule {}
Aimports should be an array, not a single module
BSharedModule should be in declarations, not imports
CProfileComponent cannot be declared in a feature module
DNgModule decorator is missing
Step-by-Step Solution
Solution:
  1. Step 1: Check imports property format

    imports must be an array, but here it is assigned a single module without brackets.
  2. Step 2: Validate other parts

    SharedModule belongs in imports, ProfileComponent can be declared, and NgModule decorator is present.
  3. Final Answer:

    imports should be an array, not a single module -> Option A
  4. Quick Check:

    imports must be an array = A [OK]
Quick Trick: Always use brackets [] for imports array [OK]
Common Mistakes:
  • Assigning imports a single module without array
  • Putting modules in declarations instead of imports
  • Missing NgModule decorator

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes