I have a slider type carousel with two section containers that can slide left and right. In my developed version I have images inside one section container. The problem I'm experiencing is that because my images from the server take a while to load I'm finding that when the user clicks the back button the page is being added to the DOM again (due to ng switch) and is having to reload the images.
My question: Is there a way to use ngif or hide/show with this instead so that the page is simply setting display: none when hidden so that the page containers not currently shown are not removed from the DOM?
<!--ANIMATE-->
<div ng-animate="{enter: 'enter', leave: 'leave';}" ng-switch on="par.selection">
<!--PAGE1-->
<div class="page page1" ng-switch-when="settings">
<b>page 1</b><br><br>
<button ng-click="par.selection = 'home'; go('front');" >go page 2</button>
</div>
<!--PAGE2-->
<div class="page page2" ng-switch-when="home">
<b>page 2</b><br><br>
<button ng-click="par.selection = 'settings'; go('back');" >go page 1</button>
</div>
</div>
Plunkr here: LINK
I made the above example from a blog I visited a phew days ago which I can no longer seem to find but the above example works using the ng-switch method.