我在控制器中的功能檢查,如果事情是確定的變化與transtionToRouteTranstionToRoute劑量不勾模型
路線起初創建包含本地存儲適配器一個新的記錄,然後我想改變路線:
var i = this.store.createRecord('axisModel', {
id: Math.random().toString(32).slice(2).substr(0, 5), //random ID generator
uniqueName: item.uniqueName,
name: item.name,
hierarchyUniqueName: item.hierarchyUniqueName,
type: 'filter',
isMeasure: item.isMeasure,
orderId: "",
isActive: true
});
i.save();
this.transitionToRoute('filters', item);
濾波器途徑代碼是這樣的:
App.FiltersRoute = Ember.Route.extend({
model:function(params){
console.log('here');
return this.store.find('axisModel',params.filters_id);
}
});
但是當路由變化,我不能執行console.log的看到「這裏」(),也我得到這個錯誤:
Assertion failed: Error while loading route: TypeError: Object [object Object] has no method 'addArrayObserver'
「item」從哪裏來? – intuitivepixel