Unloading nested views

I’m curious if anyone has come across a way to unload a nested view in ionic?

I’m hoping to have an overlay view that I can push pages onto as necessary (no problem here) but I also want to unload them back to a completely empty view state to show through back to the child states. Modals have proven to be insufficient for what I’m trying to do here. Due to the history and panes, I’m not sure there is a good workaround but I’m hoping for some suggestions.

Any thoughts are appreciated.

The very straight way to “unload” view is to go to a state, where the view is not set (no controller or template added to the view).

Like you said “using the history”.
If you have a previous state and through an user interaction like clicking on a button -> you change the state so that the subview gets shown. if you want to unshow them -> go back in history or redirect to the previous state.

I need the view to be completely blank though. No pane, no content. Its basically an overlay page that is shown at times with more complexity than a modal. I can’t go back to before any content is in the view as the back function blocks this:

goBack: function() { viewHistory.backView && viewHistory.backView.go(); }

In case this helps anyone, for now I’m using a hacky solution.

I’ve disabled caching on any pages added to the sub-view and I’ve added a ‘blank’ state that I can route to where I simply use CSS to hide the state from showing up. Works for now, I’ll look into a cleaner solution when there is time.