brantwills/Angular-Paging

Paging, click on and item and are shown the details view, hit back, end up on last currentPage

joshblair opened this issue · 0 comments

Hello, I've got paging in place and have large lists to page through. I want to figure out how to allow a user to page through pages, click into an item, lets say on the 5th page and they see the details of one of the items on the 5th page. Then if they hit the browser Back button, they end up on the 5th page again.

Currently, the currentPage gets set back to 1 and they loose their place on the 5th page. This is very frustrating to the user.

I have tried to store the currentPage value in sessionStorage similar to the following:

$window.sessionStorage.setItem('myLastPageNumber', newPage || 1);

And then look for that value in sessionStorage when they hit the back button. But the currentPage seems to get overwritten with a 1.

NOTE: I will also likely need this behavior as described above but also with filters applied. Any suggestions here are appreciated too.

Thanks much!

JB