私の Json データは次のようになります。
{"user":{"id":1,
"name":"bob",
"profile":{"id":1,
"forename":"Foo",
"surname":"Bar",
"user_id":1}}
私のモデルは次のようになります。
App.User = DS.Model.extend({
name: DS.attr('string'),
profile: DS.belongsTo('App.Profile')
});
と
App.Profile = DS.Model.extend({
forename: DS.attr('string'),
surname: DS.attr('string'),,
user: DS.belongsTo('App.User')
});
を取得しようとすると{{user.name}}
、正常に動作します。user.profile.forename
動作しません。私は自分のユーザーモデルを試しました
DS.AuthenticatedRESTAdapter.map('App.User', {
profile: {embedded: true}
});
同様に、しかしまだ動作しません。助言がありますか?