我有一个组件,当用户单击组件时,它会添加一些值来存储,我尝试使用这种方式,但出现错误:
OlapApp.MeasureListItemComponent = Ember.Component.extend({
tagName: 'li',
isDisabled: false,
attributeBindings: ['isDisabled:disabled'],
classBindings: ['isDisabled:MeasureListItemDisabled'],
actions: {
add: function(measure) {
var store = this.get('store');
store.push('OlapApp.AxisModel', {
uniqueName: measure.uniqueName,
name: measure.name,
hierarchyUniqueName: measure.hierarchyUniqueName,
type: 'row',
isMeasure: true,
orderId: 1
});
}
}
});
这是错误:
Uncaught TypeError: Cannot call method 'push' of undefined MeasureListItemComponent.js:18
是否可以将记录从组件推送到存储?为什么我无法访问商店?我的模型名称是“AxisModel”,应用程序命名空间是“OlapApp”