【发布时间】:2015-08-31 12:40:01
【问题描述】:
我是骨干新手,我想知道是否有办法将以前的模型保存在集合中作为模型本身的属性。例如,
var history = Backbone.Collection.extend({});
var myModel = Backbone.Model.extend({
defaults: {
id: '',
name: '',
history: history //history is a collection of myModel
},
//override setter so when set method is called, it will save the previous model inside history collection.
})
【问题讨论】: