Angularjs, IONIC; Hide DOM element on state changed instead of removing it

The default behavior or angularjs/ionic is to remove the DOM element when the route changed/left the page and replace it with the new DOM elm/run the controller again if you navigate back to the previous page.

Is there a way to hide the DOM elm associated to the route instead of removing it completely?

My use case is: my IONIC app landing page/index takes some time to compute/render and when the user navigate to detailed view and come back to the index page it build it again from scratch, because the DOM was removed and it needs to build again, which is a waist of time so rather than removing the DOM elm when the route changed hide it instead and if the user come back to the previous route, show it. this will definitely improve the app performance.

Looking forward to your response.

Thanks in advance

Abod

Use tabs in your project: http://ionicframework.com/docs/api/directive/ionNavView/

There is a lot of stuff to understand but this feature works great.

Basicly it allows you to change view without removing DOM (it stores it in memory). When you come back to previous DOM it's just loaded from memory.