Explaining how I define the route in my app-routing :
{ path: 'user/:id', component: UserDetailComponent },
Defining the Navigation for Users
<a [routerLink]="['/user', user.id]">detail</a>
Inside the UserDetailComponent
this.id = +this.route.snapshot.params['id'];
Initially, I can retrieve user details successfully. However, after refreshing the page (user detail/:id) an error message is displayed.