{
"code":"OK",
"message":"Success",
"errorFlag":"N",
"errors":null,
"data": {
"images": {
0: img0,
1: img1,
2: img2
}
}
}
此創建一個集合多種型號是REST響應,我希望把「影像」記錄我的收藏和對待每一個人記錄的車型。BackboneJs:從嵌套對象
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();
我怎樣才能讓「圖像」裏面的記錄是圖像集合的唯一模式,把代碼,郵件,錯誤等鍵,另一個模型或集合?
謝謝。
http://stackoverflow.com/questions/8782619/how-to-build-a-collection-model-from-nested-json-with-backbone-js –