Open gstreetmedia opened 5 years ago
When using an ES6 class, idAttribute should be returned from a getter, rather than being set in the preinitialize function.
class Meal extends Backbone.Model( get idAttribute() { return "_id"; } );
Otherwise the following will not work.
let model = MealCollection.get(someId);
Due to the use of prototype in the collection function
// Define how to uniquely identify models in the collection. modelId: function(attrs) { return attrs[this.model.prototype.idAttribute || 'id']; };
Closely related to #3560 and #4245.
When using an ES6 class, idAttribute should be returned from a getter, rather than being set in the preinitialize function.
Otherwise the following will not work.
Due to the use of prototype in the collection function