@Mik378 you can dynamically clear cache using $ionicHistory.clearCache(); but as it was defined to cache this view, the controller doesn’t run again.
I agree when you say :
But the point is the cached view already caches the $scope values (in order to repopulate them), therefore, as being simple references, it’s not such a memory waste !
and
So to sum up, yes Ionic thinks about this case wink since you can update an EXISTING cached view through those events.
Better performance than “cleaning” them and recreate them.
but if you force $ionicHistory.clearCache(), controller shouldn’t be runned again?
Had a similar problem as OP and cache: false didn’t work for me at all in 1.0.0-beta14. I tried using $broadcast events but that didn’t work as well. In the end I used a similar method to what @Foxandxss proposed. Thx!
@Delfins@mhartington
This is how I got it to work. Minimal effort and I think the most Ionic way. I created a pull request with a minor tweak to return a promise from $ionicHistory.clearCache():
@Mik378 Your approach sounds to me as a beginner very plausible, but I can’t translate it into action. Could you please give a short code example?
I didn’t find anything in the docs to update a cached view on a specific event. For me it looks like having two options: caching a view or not. But I just want to update the cashed view only if I add/edit or delete an item of the view.
Thanks for your help!
Unfortunately, it looks like there’s a bug when hydrating them from the cache, though, in regards to their $stateParams. They seem to retain their initial values when the views are first instantiated, regardless of what is sent later, at least in certain circumstances. It just doesn’t seem like that’s the intended behavior.
I have a question, whenever we perform data manipulation like add or edit a value can’t we just reload that particular view using simpler function like window.reload() provided by javascript so that the view makes a call to the server for that particular view only based on the code we have written for that particular section ?