1

I want to pass optional params such as filters & page numbers to route. I'm using RequestOptions to pass query parameters and it works for filter and paginataion, but URL never changes.

e.g: i have uri/cars route, when i click second page content is updating for 2nd page but URL still same as uri/cars.

I want uri/cars?page=2 when i do this example. Thanks.

0

1 Answer 1

3

When you call router.navigate(), you can use the queryParams object to send additional parameters.

In your example, you could use something like this:

this.router.navigate(['uri/cars'], {queryParams: {'page': 2}});

Sign up to request clarification or add additional context in comments.

2 Comments

does this provide me to change page on url ? if a write to browser url bar uri/cars?page=30, will 30st page load?
If that's how it's implemented in your application

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.