Filtering Data Using Query Parameters
Learn how to use query parameters and prevent unauthorized access to a particular route using Angular guards.
We'll cover the following...
In this lesson, we will learn about the optional query parameters. These parameters are considered optional because they aim to provide optional services such as sorting or filtering data. Some examples are as follows:
/products?sortOrder=asc
: Sorts a list of products in ascending order/products?page=3&pageSize=10
: Splits a list of products into pages of 10 records and gets the third page
Query parameters are recognized in a route by the ?
character. We can combine multiple query parameters by chaining them with an ampersand (&
) character. The ActivatedRoute
service contains a queryParamMap
observable that we can ...