Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete all data from Ember Data store? [duplicate]

In the Ember.js application I'm working on, that uses Ember-data, once the user gets to a point on the screen, I want to delete all state stored in the ember-data Store associated with the application, and start with a clean slate that can start pulling data from the server. Anyone know how to do it?

like image 923
Adam Avatar asked Jan 28 '26 10:01

Adam


1 Answers

I don't think there is an easy way. The only way ATM is loop over all your DS.Model classes and destroy the records individually.

App.Model.all().forEach(model) ->
  model.destroy();

App.Model2.all().forEach(model) ->
  model.destroy()
like image 99
ahawkins Avatar answered Jan 30 '26 18:01

ahawkins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!