Scope reinitialized when changing sub views


#1

Hi Guys,

I’m fairly new to all of this, but I’m having some issues and I’d like to see if someone can help shed some light.

I’m trying to make a music player app. Right now I’m using a setup similar to this:
http://codepen.io/ionic/pen/tcIGK (side menu and navigation)

I’ve removed all the controllers from the app.js states, and just put one controller onto the tag so that (hopefully) all the views will share the same controller.

The main reason I’m doing this is so that all views can share the same “Media” cordova object as the views change. But, it seems like every time the view changes, it reinitializes the scope or tries to create a new one or something.

I’m not sure that makes sense, but I feel like I’m missing something. Should I be trying to use the “resolve” section of the state configuration and pass in the media player object from a service each time? Is that the right way to create a “singleton” basically for each view to handle?