2013-10-02 76 views

回答

2

下已经工作了我因为ED 1.0测试2:

var child = this.get('store').createRecord('child', { 
    name: 'New Child', 
    parent: parent 
}; 
child.save(); 

parent.get('children').addObject(child); 
// My backend automatically adds the inverse of relationships when saving  
// the child, so I don't need to save the parent separately 

其中parent是父对象。您可能需要在控制器中指定needs: ['parent'],然后使用var parent = this.get('controllers.parent.content');获取父级,其中“parent”是父级对象的名称。

相关问题