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 })
});
At this point the folder is loaded (except of his children) and the children were never loaded.
I would like to make EmberJS load the children of a folder when I run {{folder.children}} inside a template without having to call more in the controller or component side.