...

/

Passing Parameters to Routes

Passing Parameters to Routes

Learn how to pass parameters to routes when paths change dynamically.

We learned that we can navigate to a route with a static path value. In this lesson, we will learn how to do this when the path changes dynamically using route parameters.

A common scenario in enterprise web applications is to have a list of items and when we click on one of them, the page changes the current view and displays details of the selected item. The previous approach resembles a master-detail browsing functionality, where each generated URL on the master page contains the identifiers required to load each item on the detail page.

We can represent the previous scenario with two routes navigating 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 ...