I'm having trouble saving Backbone.Model or Backbone.Collection objects to local storage. The problem is that only attributes are saved when saved, and I don't want this. I actually use base-localstorage, which is represented in their TODO sample.
This is their save function.
save: function() { localStorage.setItem(this.name, JSON.stringify(this.data)); }
When I look at what JSON.stringify (this.data) returns, I see that only models or collection attributes receive sets. Is there a way to indicate that I want to save all the state of the model and collection, and not just attributes?
dchhetri
source share