Bird
0
0

Identify the error in this import statement:

medium📝 Debug Q6 of 15
Angular - Standalone Components
Identify the error in this import statement:
import { FormsModule } from '@angular/forms';
Used in an Angular module but the app fails to compile.
ACurly braces should not be used for FormsModule
BMissing import of ReactiveFormsModule instead
CFormsModule should be imported from '@angular/common'
DNo error; import is correct
Step-by-Step Solution
Solution:
  1. Step 1: Verify correct package for FormsModule

    FormsModule is correctly imported from '@angular/forms'.
  2. Step 2: Check syntax correctness

    Curly braces are required for named imports like FormsModule.
  3. Final Answer:

    No error; import is correct -> Option D
  4. Quick Check:

    Correct import syntax = no error [OK]
Quick Trick: Check package names carefully for each import [OK]
Common Mistakes:
  • Confusing FormsModule with ReactiveFormsModule
  • Importing from wrong Angular package

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes