简体   繁体   中英

How do you remove data from the ember store that has been loaded?

As I click on items on my ember app the server is called and the data is loaded in the model store.

My question is how can I remove that data that is loaded in for that specific model to be removed, so that when I click on that item again it would call out to the server again and pull the data back.

I have seen some previous answers that running something like, App.store.findQuery(App.Model, {}) , would invalidate the cache, but that does not seem to work.

Is there a way to iterate over just the items that have been loaded into the store and call .reload() on them? or a way to just clear it all out?

Any ideas or help are appreciated.

Sounds like what you want to do is unload all of the cached models for a particular type?

//From a route or controller...
this.store.unloadAll('post');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM