What you will learn
Build URL-driven navigation with nested routes, parameters, guards, and lazy loading.
- Routes map URL segments to components. RouterLink creates navigation and RouterOutlet marks where the selected route renders.
- Route parameters identify resources; query parameters describe optional view state such as a filter. Read them through ActivatedRoute or component input binding when configured.
- A guard controls client navigation but is not an authorization boundary. The server must still check access to protected data and operations.
- loadComponent and loadChildren split route code so a feature can load when visited.
How it works
1URL changes
2Router matches route
3Guard checks navigation
4Lazy feature renders in outlet
Expected result
The students route loads separately and each student link creates a parameterized detail URL.
Common mistakes
Do not use a guard as the only authorization control. Avoid manual string concatenation for complex URLs. Provide a wildcard or not-found experience.
