下面是爲了從收集獲取正確的數據初始化時,應接收模塊的名字來查看我的初始化函數。listenTo上收集復位收集後不被調用是獲取
的問題是:後收集獲取
- Listento不重定向到render()方法,還它給我的控制檯
TypeError: e is undefined
上的錯誤我用下面的代碼犯了什麼錯誤?
initialize: function() {
var that = this;
if(this.options.module === 'questions'){
require([
'app/collections/questions'
], function(QuestionsCollection){
var moduleCollection = new QuestionsCollection();
that.collection = moduleCollection;
moduleCollection.fetch({
reset: true,
success: function(){},
error: function(){}
});
});
}
this.listenTo(this.collection, 'reset', this.render);
this.listenTo(Backbone, 'close:Home', this.close);
},
我相信你分析的問題,但你建議如何在這種情況下做的,我用這個解決方案,以減少僅由從服務器請求加載的文件的數量。 – ahmedsaber111