Home Recent changes

Backbone

Instancier une collection

Ne fais pas :

var tagCollection = new MyApp.TagCollection({});

Mais

var tagCollection = new MyApp.TagCollection();

ça t'évitera d'avoir un élément vide avant le fetch

Utiliser sync et async

https://github.com/jeromegn/Backbone.localStorage/pull/9/files

Backbone.serverSync('update', model, options);

tempCollection.sync = Backbone.serverSync;

tempCollection.fetch( { success: blah, error: blah });

https://gist.github.com/lukecanvin/3149717