Bird
0
0

Identify the error in this route configuration:

medium📝 Debug Q6 of 15
Angular - Routing
Identify the error in this route configuration:
{ path: 'settings', loadChildren: './settings/settings.module#SettingsModule' }
AloadChildren should be a component, not a string
BMissing component property for the route
CPath should be an array, not a string
DUsing string syntax for loadChildren is deprecated and causes errors
Step-by-Step Solution
Solution:
  1. Step 1: Recognize deprecated syntax

    Using a string with '#' to specify module is deprecated in Angular.
  2. Step 2: Identify correct syntax

    Modern Angular requires loadChildren to be a function returning import().then(...).
  3. Final Answer:

    Using string syntax for loadChildren is deprecated and causes errors -> Option D
  4. Quick Check:

    Deprecated loadChildren string syntax = D [OK]
Quick Trick: Avoid string syntax; use dynamic import() for lazy loading [OK]
Common Mistakes:
MISTAKES
  • Using old string syntax for loadChildren
  • Confusing component with loadChildren
  • Wrong path type for route

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes