Setting up Dynamic Routes
Learn to make dynamic routes.
We'll cover the following...
Dynamic routes are used to load dynamic data into the routes. They can load different data models on the same route.
What do we want to achieve?
We need three dynamic routes in our application:
- The
edit
route: To edit products, we need to load them first. Every product has a unique ID. We need to load the data model to theedit
route based on that ID’. Here, we need the URL to behttp://localhost:4200/admin/edit/<id>
. - The
category
route: We need to show products by category to the users. There can be several categories in our application, and we can’t make a separate route for each category. We need