Ionic/AngularJS - Keep UI state between views

I've been using Ionic/AngularJS in several projects and I'm always struggling on the same issue.

I process some data with several kinds of displays (list, map) and when the user clicks on an element, it redirects him to a details page.

It should be good if the framework allows us to keep the UI state of the previous view, so when the user clicks on the back button on the details page, the previous page holds infinite-scrolling position or google map state.

As a workaround, my details page are always modals so when the user wants to go back, the modal closes and the background content state is kept. Nevertheless, this is not an ideal way of coding because the code is way harder to understand, and some problems happens concerning memory (imagine that the details page is linked to another details page, so you have modals opening infinitely...)

Is there a way to keep UI state of a page?

Just to clarify, I'm not talking about variables state (easy to store: $rootScope, localStorage, POST variables, cookies...).

TL;DR: I have a google map, when I click on a marker, it's redirecting me on a details page, when I go back, I want to get the google map state back, how can I do it?

I think you can create a controller which will be used as a base controller for your other controllers. You can put some data in this base controller and inject it in your controllers responsible for google maps and its details