Open dousylanse opened 11 years ago
It well tested with collections, need to investigate more to play with model. Marked your question as a bug.
@dousylanse did you manage to make it work with models ?
I leave the framework backbone to use angular instead. I'm sorry but i didn't make it work.
Hmm... I'm just now realizing that I can't persist models to localStorage. I'm not expert on Backbone yet, so I'll do my best to report back with a solution. In the meantime, if anyone can offer up some suggestions, I'd be grateful.
I am trying to fetch a simple model (not a collection). I've added the updated_at field and storage field on my PhotoModel :
Then trying to fetch it: photo = new PhotoModel({personId:personId}); photo.fetch();
Problem : Object [object Object] has no method 'reset' backbone.offline-0.9.10.js:279
I've inspected a little the offline code. line 12 : it's the first fetch so my model doesn't have id => store.findAll line 279 : response is correct : a json object (a single one, not a table) and _this.collection.items seems to be my PhotoModel so doesn't have a reset function.
My question :
Is Backbone.offline able to work with simple model or does it work only with collection ?
Thank you for your work,
Regards