Is there a way to programmatically clear the cache for a view?
For example I have a view that upon loading fetches the person from a server:
person/:personId
On another view I perform updates to that person, persist them to server (and perform some server processing on updates) and navigate back to ‘person/:personId’. Since the view ‘person/:personId’ is cached the person is not refetched. Ideally I could programmatically do something similar to:
@KyleT You could listen on $ionicView.beforeEnter event in your view controller and fetch the data from server, before view becomes active. Something like this -
Sorry, I think this is topic I need. My problem is I am getting a scrambled view when switch between running an App and the Intro instructions. I think it’s a caching problem. Here is a picture of what I am getting.
This is just a simple password generator and the problem happens when I switch from App to Intro. Does this sound like a cache problem? I notice when switching back to Intro the background is blue, which is background color of App. The Intro background should be white so somehow I am confusing the operation between App and Intro. If I need to post code I have no problem because all I am trying to do is release this as a free App. One more thing I notice is that the problem does not happen consistently but it is an issue. The ionic version I am using is 1.3.0 — thank you
I would also like to see the ability to clear cache for a certain view added in to Ionic core. I just had this need pop up last night. For now, I’m just using clearCache() and clearing the full cache. It seems a bit less clunky than having to rely on beforeEnter. Though I am also using beforeEnter in some places to make sure some of the data in my view is fresh.
you can try to log the stateId of your another view,
the stateId of your view might be appended with its state params
eg:
your state name is ‘article’ with state params ‘id’,
your stateId might be article_id_blabla