In order to use route parameters, you need to complete a few simple steps in your code:
{ path: '', redirectTo: 'all-products', pathMatch: 'full' },
{ path: 'all-products', component: ProductList },
{ path: 'product-details/:id', component: ProductDetails }
];
The last entry in this Routes section is product-details/:id. The :id portion is the route parameter and will be replaced by the value passed into the URL, in this case an id of 1, such as:
http://products.html/product-details/1
In the tutorial lab you will configure and use parameters with the routes you configure for the Git Search application.
Almost done…
We just sent you an email. Please click the link in the email to confirm your subscription!