Bird
0
0

Given this route config:

medium📝 component behavior Q4 of 15
Angular - Modules
Given this route config:
{ path: 'dashboard', loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule) }

What happens when the user navigates to '/dashboard'?
ADashboardModule is loaded immediately when app starts
BDashboardModule is never loaded automatically
CDashboardModule is loaded but its components are not rendered
DDashboardModule is loaded only when '/dashboard' route is accessed
Step-by-Step Solution
Solution:
  1. Step 1: Understand lazy loading behavior

    Modules with loadChildren load only when their route is visited.
  2. Step 2: Apply to given route

    DashboardModule loads only when user navigates to '/dashboard'.
  3. Final Answer:

    DashboardModule is loaded only when '/dashboard' route is accessed -> Option D
  4. Quick Check:

    Lazy load triggers on route access = DashboardModule is loaded only when '/dashboard' route is accessed [OK]
Quick Trick: Lazy load triggers on route navigation [OK]
Common Mistakes:
  • Assuming module loads at app start
  • Thinking module never loads
  • Confusing loading with rendering

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes