0Pricing
Angular Academy · Lesson

Route Parameters and Query Params

Read and react to route parameters.

Route params vs query params

Route params are part of the path (/user/42). Query params are appended after ? (/search?q=ng&page=2). The router gives you reactive access to both.

Defining a route param

Use a colon in the path to declare a parameter.

export const routes = [
  { path: 'user/:id', component: UserComponent }
];

All lessons in this course

  1. Route Parameters and Query Params
  2. Resolvers and Route Data
  3. Functional Route Guards
  4. Router Events and Navigation
← Back to Angular Academy