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
- Route Parameters and Query Params
- Resolvers and Route Data
- Functional Route Guards
- Router Events and Navigation