Bird
0
0

You want to migrate a feature module with multiple components to standalone components. What is the best approach?

hard📝 Conceptual Q8 of 15
Angular - Standalone Components
You want to migrate a feature module with multiple components to standalone components. What is the best approach?
AConvert each component to standalone and import shared dependencies individually
BKeep the NgModule and only convert one component to standalone
CRemove all NgModules and rely on global imports only
DConvert components but keep them declared in the original NgModule
Step-by-Step Solution
Solution:
  1. Step 1: Understand migration of feature modules

    Each component should be converted to standalone and import its own dependencies.
  2. Step 2: Avoid mixing standalone components with NgModule declarations

    Keeping components declared in NgModule or relying on global imports defeats standalone benefits.
  3. Final Answer:

    Convert each component to standalone and import shared dependencies individually -> Option A
  4. Quick Check:

    Migrate all components standalone with imports = A [OK]
Quick Trick: Migrate all components standalone with their imports [OK]
Common Mistakes:
  • Mixing standalone components with NgModule declarations
  • Relying on global imports instead of explicit imports
  • Converting only some components partially

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes