mardi 8 mars 2016

ember js defining a model for an object containing arrays

here is my code , I have defined a model containing arrays , the problem is that when i send it to the server it does not sends the arrays

import DS from 'ember-data';

export default DS.Model.extend({
titre: DS.attr('string'),
categorie: DS.attr('string'),
introduction: DS.attr('string'),
chapitres: [{
    titre: DS.attr('string'),
    introduction: DS.attr('string')
    sousChapitres: [{
        contenu: DS.attr('string'),
        }],
    exercices: [{
        contenu: DS.attr('string')
        }],
    conclusion: DS.attr('string')
    }]
});

thank you,




Aucun commentaire:

Enregistrer un commentaire