> angular-routing

Standards for Angular Router, Lazy Loading, and Guards. Use when configuring Angular routes, lazy-loaded modules, route guards, or resolvers. (triggers: *.routes.ts, angular router, loadComponent, canActivate, resolver)

fetch
$curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/angular-routing?format=md"
SKILL.mdangular-routing

Routing

Priority: P0 (CRITICAL)

Principles

  • Lazy Loading: Use loadComponent for standalone components and loadChildren for route files.
  • Functional Guards: Use function-based guards (CanActivateFn) instead of class-based guards (Deprecated).
  • Component Inputs: Enable withComponentInputBinding() to map route params directly to component inputs.

Guidelines

  • Title Strategy: Use TitleStrategy service to auto-set page titles from route data.
  • Resolvers: Use resolve to pre-fetch critical data before navigation completes, but avoid blocking UI for too long.

Anti-Patterns

  • Logic in Routes: Keep route definitions clean. Move logic to Guards or Resolvers.
  • Eager Loading features: Never direct import feature components in root routes.

References

┌ stats

installs/wk0
░░░░░░░░░░
github stars341
██████████
first seenMar 17, 2026
└────────────

┌ repo

HoangNguyen0403/agent-skills-standard
by HoangNguyen0403
└────────────

┌ tags

└────────────