I have the following problem in an angular application: - first page is a search page, with a form and a search list. Search results are paginated, ia there's a button "show more" that displays the next 10 results - clicking on a result brings to the second page, with detailed information about the element (just a classic search behaviour).
Now my problem is the following: from the element page, clicking on the browser's BACK button brings the user to the search page, but the search is lost.
I implemented a cache, in order the form to be stored in a service - this way I can relaunch the search automatically. But in this case, the scrolling is lost and only the ten first results are displayed (pagination is lost).
This only solution I see is to add an entry in the history each time the "show more" button is clicked, but I will also have to save somewhere the scrolling level of the window. I find this solution quite complicated and annoying, not beautiful.
So question is: is there an common and easier way to do it?
I think this is a usual problem of ajax/angular application, in deezer when I select an album I have the same).