Working with route parameters
Whether it is about building a REST API using Node.js or configuring routes in Angular, setting up routes is an absolute art, especially when it comes to working with parameters. In this recipe, you'll create some routes with parameters and will learn how to get those parameters in your components once the route is active.
Getting ready
The app that we are going to work with resides in start/apps/chapter07/ng-route-guards
inside the cloned repository:
- Open the code repository in your Code Editor.
- Open the terminal, navigate to the code repository directory and run
npm run serve ng-route-guards
to serve the project
This should open the app in a new browser tab. And you should see the following:
Now that we have the app running locally, let's see the steps of the recipe in the next section.
How to do it…
The problem right now is that we have a route for opening the user...