1
我試圖改變我的意見,當模型屬性發生變化 林不知道我是否在正確的軌道上,但在這裏。在子路徑中過濾RecordArray以返回RecordArray?
我有叫午餐父資源,其路徑看起來像這樣:
model: function(params){
return this.store.filter('lunch', params, this.funcAll);
}
,我有一個孩子的路線「服務」,其路徑看起來像這樣:
model: function(params){
return this.modelFor('lunches').filterProperty('isServed', true);
// as opposed to this.store.filter('lunch', this.funcFilter()})
}
當我在子路徑中使用過濾器,我能夠做到這一點(我認爲是因爲一個過濾器返回一個RecordArray),但這不適用於我,另一個原因。無論如何,我可以讓我的子路線返回一個RecordArray,它是原始模型的一個子集?
非常感謝主銷!我發現我犯的錯誤很多。但是,多虧了你,我已經明白了這一點。 – user3874510