Non desired caching for forward view

Hello,
i’ve been trying to find a solution to my problem,
I am working on an app that uses the tabs template, one of the tabs has three views inside it
So suppose i’m on Tab1, View1, navigating to View2, filing data in it, and navigating back to View1 and View2 again, the data will be purged (DOM elements are cleared as expected and scope is reconnected to watch cycle as expected), however, going from View1 --> View2 (fill data) --> View3 --> View1 --> View2 again, data is not purged !!

is there a way to fix this behaviour ? should i explicitly tell View3 that after entering View1, reset history or similar?

THANKS!!

// By default, views are cached to improve performance.
// Set $ionicConfigProvider.views.maxCache(0); to disable cache globally
// See: http://ionicframework.com/docs/api/directive/ionNavView/

or on a case by case (cache: false) basis:

.state('app.main', {
        url: '/main',
        cache: false,
        views: {
          'menuContent': {
            templateUrl: 'templates/main-template.html',
            controller: 'MainController',
            resolve: {
              posts: function(PostsService) {
                return PostsService.findPosts();
              }
            }
          }
        }
      })

Thanks for your reply, i am aware of the possibility to disable cache, either on a global or local scope,

the thing is, if i disable the cache for View2, going back from View3 to View2, removes the data from the view… i would like to be able to persist the data as long as i haven’t closed a complete flow,
meaning, persist data on View1 --> View2 --> View3 , but if i moved out View3 (excluding going back to View2), clear cache and remove data…

Is that possible?

How have you defined them?

Are they nested states?

Do you have a Plunker?

Seems like solution was easy enough, i used $ionicHistory.clearCache()