1. How do you read a route parameter like /users/42?
Declare the param in the route path (e.g., 'users/:id'). In the component, read it using ActivatedRoute. Use snapshot for one-off or params/paramMap observables for reacting to changes when the same component stays mounted.
{ path: 'users/:id', component: UserDetailComponent }
constructor(private route: ActivatedRoute) {}
ngOnInit(){
const id = this.route.snapshot.paramMap.get('id');
this.route.paramMap.subscribe(p => this.load(p.get('id')));
}