Proper way to store variables between views in Ionic Framework (Phonegap)

I have following problem: in my app based on Ionic Framework I have something like authentication: I log in and after that store token in a service.

But what is a proper way to store variables? I could use services, localStorage, (something else)?

For example, after login I want to show a list and depending on choice (on an id from a list) show something in details tab, but still have an ability to move for example to account tab, or other tab and still have an information on selected choice (like, clicking on details tab still would show previously selected item).

So how for example store such a variable?

I hope I didn't mess the explanation of my problem too much.

Thanks :)

You can use localStorage. It's pretty good for this kind of little things.

localStorage.setItem("storage_name","something");
var another_variable=localStorage.getItem("storage_name");

And if you need the values even after restarting the app, then you will need something like webSql, specially for iOS