Chris Anderson

Chris Anderson

  • NA
  • 93
  • 8.4k

Keep last query parameter when navigate back and forth between pages

Mar 30 2021 10:44 AM
Hmm see if I can get my question through as good as possible as a newbie on Angular.
I have a list that can be filtered in different ways. By date, name i.e, say on a products page.
 
Scenario
1. User enters the startpage
site.com
 
2. From startpage user enters the productpage
site.com/products
 
3. User filters on date which adds to the URL:
site.com/products?Name=Hello
 
4. User make yet another filtering on date:
site.com/products?Name=Hello&fromDate=2019-02-02&toDate=2021-03-30
 
The problem - Navigating backwards through filters
When navigating backwards the user now has to walk all the way through the same steps in reverse, 4, 3, 2, 1. Having to step through every filterings made.
 
What I'm looking for:
I would rather prefer going backwards from step 4 to step 1. Then when moving forward again going from 1 to 4 directly. 
 
Bottomline
How to get rid of middle steps when navigate back and forth on pages using filters and query parameters. 

Answers (1)