3

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?

Adam
  • 3,148
  • 19
  • 20

1 Answers1

2

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()
ahmacleod
  • 4,280
  • 19
  • 43
ahawkins
  • 1,164
  • 1
  • 10
  • 15
  • Thanks, that's what I was seeing in the code for ember-data, just wasn't sure if maybe there was something I was missing. – Adam Mar 02 '13 at 21:56