I have a SPA (single page app). I am trying to keep data of one route, when moving to another, so if a person returns to the route, he'll see it in exactly the same state he left it.
In example, I have an inbox page (e.g. #/inbox).
On this page, a person can see his inbox, and gets new messages to the inbox when he stays on this page. Unread emails are in bold, read emails are normal and they are sorted and filtered in a certain manner the user has chosen.
The app gets one "push" of emails from the server, and then updates when it runs.
It works fine.
The problem arises when this person "navigates" away from the inbox "page".
The navigation is from #/inbox to #/other-page - each has its own controller and view.
After the person navigates away, and then comes back to the page, the page resets - e.g. the inbox starts from scratch, there are no unread emails in bold, filters are reset etc.
I followed instructions given me here, to keep the data in a service, but when I get back to #/inbox, the service resets and I lost the data.
How do I keep such data, so the person would see the same inbox page after navigating the rest of the SPA?
Or is there a smarter way than just rebuilding the page with saved data?
Thanks