{
"code":"OK",
"message":"Success",
"errorFlag":"N",
"errors":null,
"data": {
"images": {
0: img0,
1: img1,
2: img2
}
}
}
This is a REST response and I wanted to put the "images" records in my collection and treat each individual records as models.
var Image.Model = Backbone.Model.extend({});
var Image.Collection = Backbone.Collection.extend({
model: Image.Model,
url: 'rest/url'
});
var images = new Image.TestCollection();
images.fetch();
How can I make the records inside the "images" be the only models of the image collections and put the code, message, errors etc. keys to another models or collections?
Thank you.