我有一个代码:
Application = function() {
Application.prototype.currentQuote.collection.fetch();
};
Application.prototype = {}
Application.prototype.currentQuote = {};
Application.prototype.currentQuote.model = new (Backbone.Model.extend({
defaults: {
products: []
}
}))();
Application.prototype.currentQuote.collection = new (Backbone.Collection.extend({
model: Application.prototype.currentQuote.model,
url: 'test.json'
}))();
App = new Application();
但是,当获取集合时,我得到“未捕获的类型错误:对象不是函数”错误。我不明白为什么,我能解决什么?
您可以在此处查看测试用例:https ://dl.dropbox.com/u/15806777/development/bb/index.html
谢谢!