# Route Parameters — Angular

Source: https://www.geekswithgeeks.com/en/angular/ng-route-params

> Read dynamic segments of the URL, like an item id.

## A parameterized route

A colon marks a dynamic segment: `:id` matches any value at that position in the URL.

```typescript
export const routes: Routes = [
  { path: 'products/:id', component: ProductDetailComponent },
];
```

## Reading the param

`ActivatedRoute` exposes the current route's parameters, either as a snapshot or an observable.

```typescript
export class ProductDetailComponent {
  private route = inject(ActivatedRoute);
  productId = this.route.snapshot.paramMap.get('id');
}
```
