我正在使用 ember-data 12 我有 2 个模型,它们一起加载:
App.Store = DS.Store.extend({
revision: 12,
adapter: App.Adapter.create()
});
App.Propose = DS.Model.extend({
meeting: DS.belongsTo('App.Meeting'),
time: DS.attr('string'),
});
App.Meeting = DS.Model.extend({
name: DS.attr('string'),
proposes: DS.hasMany('App.Propose'),
});
我如何从提议模型中获得会议,例如从一些计算字段:
App.Propose = DS.Model.extend({
meeting: DS.belongsTo('App.Meeting'),
time: DS.attr('string'),
someCalc:function(){
this.get('meeting').get('name') //I want that. but its not worked
}
});