【发布时间】:2013-08-22 11:09:18
【问题描述】:
使用REST Adapter,可以通过以下方式嵌入对象:
App.Adapter.map('App.User', {
properties : {embedded: 'always'},
});
如何使用FIXTURE 声明嵌入对象?我已经尝试在模型中指定这个:
App.User = DS.Model.extend({
properties : DS.belongsTo('App.UserProperties', { embedded : true })
});
但这不起作用。是否可以使用FIXTURES 嵌入对象?我的FIXTURE 看起来像:
App.User.FIXTURES = [
{
id: 'id1',
type: 'user',
properties : {
name: 'Max Smith',
email: 'max.smith@email.com' }
},
];
【问题讨论】:
标签: ember.js ember-data