var attr = DS.attr,
hasMany = DS.hasMany,
belongsTo = DS.belongsTo;
Admin.Category = DS.Model.extend({
name: attr(),
mstore: belongsTo('mstore')
});
console.log(mstore); // this is a PromiseObject object passed from "{{action createCategory mstore}}" tag
var newCategory = this.store.createRecord('category', {
name: 'nn',
mstore: mstore
});
我收到如下错误:断言失败:您只能向此关系添加“mstore”记录。
如何使用 PromiseObject 对象设置 belongsTo 属性?谢谢。