Bird
0
0

What happens if you remove FormsModule from the module imports but keep it in the standalone component imports?

hard🚀 Application Q9 of 15
Angular - Template-Driven Forms
You have a module importing FormsModule and a standalone component importing FormsModule as well. What happens if you remove FormsModule from the module imports but keep it in the standalone component imports?
AThe standalone component's template-driven forms still work correctly
BThe entire app loses FormsModule features
CThe standalone component throws an error due to missing FormsModule in module
DFormsModule must be imported in both places or neither
Step-by-Step Solution
Solution:
  1. Step 1: Understand module vs standalone imports

    Standalone components manage their own imports independently from modules.
  2. Step 2: Effect of removing FormsModule from module

    If standalone component imports FormsModule, it works regardless of module imports.
  3. Final Answer:

    The standalone component's template-driven forms still work correctly -> Option A
  4. Quick Check:

    Standalone imports override module imports for that component [OK]
Quick Trick: Standalone imports are independent; module import not required for them [OK]
Common Mistakes:
MISTAKES
  • Assuming module import is always required for standalone components
  • Thinking FormsModule must be imported everywhere
  • Confusing module and standalone import scopes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes