Suggest an editImprove this articleRefine the answer for “How do you declare a route parameter?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A route parameter is declared with a colon `:` in the `Routes` configuration, for example `path: 'user/:id'`. **Key point:** the parameter is declared with `:param` in the route, substituted dynamically in the URL, and read in the component through `ActivatedRoute`.Shown above the full answer for quick recall.Answer (EN)ImageA route parameter is declared with a colon `:` in the `Routes` configuration. Example: ```ts const routes: Routes = [ { path: 'user/:id', component: UserComponent } ]; ``` Here `:id` is the route parameter. For a path like `/user/10`, Angular will load `UserComponent`, and the value `10` becomes the `id` parameter. To get this parameter in the component, use `ActivatedRoute`: ```ts constructor(private route: ActivatedRoute) {} ngOnInit() { const id = this.route.snapshot.paramMap.get('id'); } ``` --- **Summary:** - In a route, a parameter is declared with `path: 'route/:param'`. - In the URL, it is substituted dynamically. - In the component, it is read through `ActivatedRoute`.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.