0
我得到的一些數據和與之建立集合是這樣的:骨幹:A「URL」屬性或功能必須指定
reader: function(fileName){
console.log(fileName);
_this = this;
$.ajax({
type: "GET",
url: "some/rest/url",
data: {"fileName": fileName},
success: function(response) {
console.log("reader");
console.log(response);
importCollection = new ImportCollection(response);
importCollection.sync();
}
});
},
我的收藏是這樣的:
define([
"underscore",
"backbone",
"models/import",
"helpers/localstorage"
],
function(_, Backbone, ImportModel, localstorage) {
return Backbone.Collection.extend({
model: ImportModel,
url: "some/rest/url",
projectId: null,
fetch: function(options){
//TODO remove this hardcode
console.log(options.url);
this.url = this.url + "/PU000101/reader";
Backbone.Collection.prototype.fetch.call(this,options);
}
});
});
而且我的模型是這樣的:
define([
"models/base"
], 功能(BaseModel){
return BaseModel.extend({
idAttribute: "id",
url: "some/rest/url",
});
});
理想我想上同步發生的是什麼,該集合將發佈旗下所有車型到後端進行驗證,但我不斷收到此錯誤:A "url" property or function must be specified