I have this code:
app.Collections.quotes = new app.Collections.Quotes();
app.Collections.quotes.fetch({
success: function(){
console.log(app.Collections.quotes.at(0).get("NetAmount"));
}
});
Console.log returns ‘undefined’.
Yet, I can see the returned response from the server is an array of Objects and Backbone does actually create 27 models, but none of them have any attributes!
Any ideas?
As per question comments, it looks like you may have overridden
Model.parse. If you do, you need to return the attributes hash you want to set as the model’s attributes: