Ember-data does not support inline objects

I am working with ember data rev-11 and django tastypie data. It seems that now ember-data data does not support embedded resources, but support side loads (django tastypie does not support it). What is the best solution?

thank

0
source share
1 answer

This is not true for Ember Data 1.0 beta +, see duplicate answer

Ember data still supports inline. You just need the right configuration. Here's how you can do it:

DS.RESTAdapter.map('App.Foo',{
    bar:{
        embedded:'always'
    }
})

App.Foo = DS.Model.extend({
    bar: DS.belongsTo(App.Bar,{embedded:'always'}),
});

Available values ​​for built-in: always and load.

load : child records are implemented at boot time, but should be kept as separate records. For this to work, baby records must have an identifier.

: . , , ( , ).

HasMany, .

+15

All Articles