vendredi 26 décembre 2014

Is there any example for reflexive relation?

I am trying iterate json response which more likely mentioned below and I want achieve this model through reflexive relation.



{
folders : [

{
id : 1,
folders [ { id : 1, folders : [] } ]
},
{
id : 2,
folders : [{ id : 1, folders : [ {id:1 , folders : [] }] }]

}

]
}


I here is my try children: DS.hasMany('folders', {inverse: 'parent'}), parent: DS.belongsTo('folders', {inverse: 'children'})

But does't work at all . is there any example ?





Aucun commentaire:

Enregistrer un commentaire