You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var MyModel = Backbone.AssociatedModel.extend({
relations: [{
type: Backbone.Many,
key: "entities",
collectionType: EntityCollection
}],
parse: function(res) {
// This gets called twice. When the response comes back
// and then when setting the `entities` key
return res.entities;
},
url: "myUrl"
});
model = new MyModel();
model.fetch();
When backbone-associations calls set when creating the EntityCollection with the key of entities it passes the options from the fetch which Backbone automatically sets the parse option to true which calls the parse function when setting the collection. In this case this would throw an undefined error since parse is getting called with just the array.
I'm not sure if this is a Backbone specific issue or not. Has anybody else ran into this issue?
The text was updated successfully, but these errors were encountered:
When backbone-associations calls
set
when creating the EntityCollection with the key ofentities
it passes the options from thefetch
which Backbone automatically sets theparse
option to true which calls the parse function when setting the collection. In this case this would throw anundefined
error since parse is getting called with just the array.I'm not sure if this is a Backbone specific issue or not. Has anybody else ran into this issue?
The text was updated successfully, but these errors were encountered: