jeudi 2 mars 2017

EmberJS - Lazy loading inside a template

How can I lazy load relationship inside the template?

// models/folder.js
export default DS.Model.extend({
  children: DS.hasMany('item', { inverse: 'parent', async: true })
});

// models/item.js
export default DS.Model.extend({
  parent: DS.belongsTo('folder', { inverse: 'children', async: true })
});

I thought using async: true I will be able to run . Note that the children were never fetched before.




Aucun commentaire:

Enregistrer un commentaire