Passing parameters to routes
A common scenario in enterprise web applications is to have a list of items, and when you click on one of them, the page changes the current view and displays details of the selected item. This resembles a master-detail browsing functionality, where each generated URL living in the master page contains the identifiers required to load each item in the detail page.
We can represent the previous scenario with two routes that navigate to different components. One component is the list of items and the other is the details of an item. So, we need to find a way to create and pass dynamic item-specific data from one route to the other.
We are tackling double trouble here: creating URLs with dynamic parameters at runtime and parsing the value of these parameters. No problem: the Angular router has got our back, and we will see how using a real example.
Building a detail page using route parameters
We need to refactor the Angular CLI project that we...