Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4828

Lazy loading inside a template

$
0
0

@Charles_Bourasseau wrote:

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.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles