[Answered ]-Cannot populate backbone collection from backbone.js tutorial

2👍

Out-of-the box, Backbone expects your objects to be at the root of your response. If they’re not, it needs some help to determine what part of the response it can use when instantiating model objects.

Basically you just need to define a Backbone model and add your own parse function:

var user = Backbone.Model.extend({
    parse: function(response) {
        return response.objects;
    }
});

Now your model will know where it can find the properties you want to set.

Leave a comment