Performance: Router outlet for view rendering
MEDIUM IMPACT
This affects how quickly the main content appears and how smoothly navigation between views happens.
Use a single <router-outlet></router-outlet> with lazy-loaded feature modules and minimal nested outlets.
In the main component template: <router-outlet></router-outlet> with many nested router outlets and heavy components loaded eagerly.
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Eager loading many nested router outlets | High (many nodes added at once) | Multiple reflows per route change | High paint cost due to large DOM | [X] Bad |
| Single router outlet with lazy-loaded modules | Low (only active view nodes) | Single reflow per route change | Low paint cost with smaller DOM | [OK] Good |