Skip to content
Learn Netverks

Lesson

Step 27/36 75% through track

router-links-params

Router links and params

Last reviewed May 28, 2026 Content v20260528
Track mode
client_angular
Means
In-browser Angular TS
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches Router links and params: the concepts, APIs, and habits you need before advancing in Angular.

Routing maps URLs to components—guards and resolvers protect enterprise flows.

You will apply Router links and params in contexts like: Multi-page SPAs with lazy-loaded feature modules and guarded admin areas.

Write TypeScript with decorators, click Run—Angular 19 loads from CDN, use the Ng global and mountApp(Component) with selector app-root; printOutput feeds the terminal.

When you can explain the previous lesson's ideas without copying starter code.

routerLink navigates declaratively in templates—prefer it over manual history.pushState so Angular stays aware of navigation. ActivatedRoute exposes params (path segments like :id) and query params (?tab=settings).

Common patterns

  • [routerLink]="['/users', userId]" — path params
  • routerLink="/reports" [queryParams]="{ year: 2026 }" — query string
  • Subscribe to route.paramMap or use toSignal(route.paramMap) in modern apps

Compared to Vue Router / React Router

All three separate URL state from component trees. Angular’s router is deeply integrated with DI, guards, and resolvers for enterprise workflows.

Important interview questions and answers

  1. Q: Path param vs query param?
    A: Path params identify a resource (/users/42); query params filter or configure views (?sort=name).
  2. Q: Why avoid reading window.location directly?
    A: The router abstraction keeps navigation testable and syncs with guards, outlets, and lazy loading.

Self-check

  1. What query param does the playground simulate?
  2. How would you link to /users/7 with routerLink?

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • routerLink example?
  • Query vs path param?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump