Controller LifeCycle


I’m using the sidemenus and they are working well. However, I’ve noticed that an image that I load through firebase doesn’t appear after I switch to a different view and then come back to the view with the image.

      <pane side-menu-content>
        <pane nav-router animation="slide-left-right-ios7">
  1. When views are swapped in/out, does the associated controller start from scratch?

  2. Where is the best place to ‘cache’ data so it isn’t lost when switching between views?

For now, I’m saving the base64 image in an Service factory variable.


When using ng-router with Angular, as soon as the route changes, it loads the associated controller. So, if you are using a separate controller for the side-menu, you are essentially starting from scratch.

Sharing data between views / controllers is best done with Services. If you are already storing the image in a Service factory, you shouldn’t have any trouble accessing it in all the other controllers.


Thanks @Calendee!

I am able to access it from the other controllers and it works great!


Thanks @Calendee, I have used a List Controller and Detail Controller, and when i switch back and forth, it gives a delay of more than 2-3 secs. Let me check this out.