0

In my application im using LSA and im need to use relation in my model for example i have post and comment models like this :

App.Post = DS.Model.extend({
 title:DS.attr('string'),
 comments:DS.hasMany('comments')
});

App.Comments=DS.Model.extend({
 content:DS.attr('string'),
 post:DS.belongsTo('post')
});

i want to know ho to create a child relationship between post and comments and how to update commnets of post.

4

1 回答 1

0

我也一直在努力正确地做到这一点。请参阅使用 Ember.js 持久化子模型的正确方法是什么?由 hasMany 关系定义的 Ember 子代突然变为嵌入式模型

我最终为我发现的问题编写了自己的修复程序。在此处查看拉取请求:https ://github.com/rpflorence/ember-localstorage-adapter/pull/26

于 2013-10-02T11:39:05.150 回答