Ember Data合并嵌套的多对多关系

时间:2016-03-02 18:00:28

标签: javascript asynchronous ember.js ember-data

考虑这些模型:

用户

export default DS.Model.extend({
    name: DS.attr('string'),
    groups: DS.hasMany('group'),

    permissions: Ember.computed('groups.@each.permissions.[]', groups => {
        // What to do here?
    })
});

export default DS.Model.extend({
    name: DS.attr('string'),
    permissions: DS.hasMany('permission')
});

权限

export default DS.Model.extend({
    name: DS.attr('string')
});

如何在permissions上获得包含所有User Permissions的所有Groups的{​​{1}}媒体资源?

0 个答案:

没有答案