var BasicModel = Backbone.Model.extends({
url : function() {
return "/something";
}
});
var basicModel = new BasicModel();
basicModel.fetch();
如果BasicModel是一個集合,那麼follwoing可能 t
爲什麼在集合中使用模型,有人可以解釋我嗎? 例子: var model = Backbone.Model.extend({
url: '/rest/article/'
});
var collection = Backbone.Collection.extend({
url: '/rest/article',
model: model
});