vendredi 29 janvier 2016

Embedded model does not display from cache

When trying to load embedded data, I have a problem in that when the model is already cached on my page, this embedded data will not load in the view. If, however, it it is reloaded from scratch and therefore read from the API, it does load. I can see that the data is being loaded into the model from the Ember inspector plugin, however. If you could tell me the issue here so that the data will load every time, this would be appreciated. Many thanks.

import DS from 'ember-data';
import WebApiSerializer from 'ember-web-api/serializers/web-api';

export default WebApiSerializer.extend(DS.EmbeddedRecordsMixin,{
    attrs: {
        subjects: { embedded: 'always' }
    }
});

Models

import DS from 'ember-data';

export default DS.Model.extend({
    name: DS.attr('string'),
    graduationDate: DS.attr('string'),
    institutionLevel : DS.attr('string'),
    subjects: DS.hasMany('subject'),
    cv: DS.belongsTo('cv')
});

import DS from 'ember-data';

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




Aucun commentaire:

Enregistrer un commentaire