vendredi 6 février 2015

Ember-data: Child data not being fetched when displayed in template

I have the following hasMany structure:



> listing event
> -- artist
> --- image


listing event has many artists, artists have many images


when displaying a list of listing events the artists are fetched accordingly - however because images are another level down they aren't. Totally get why.


However.


Say I am doing the following:



{{#each listingEvent in listingEvents}}

{{#each artist in le.artists}}

{{render "artist/artist-tile" artist}}

{{/each}}

{{/each}}


And inside my render template I have the following:



{{#each image in artist.images}}

{{image-helper artist.images.url 'c_fill,h_30,w_20'}}

{{/each}}


I would expect images to be fetched? How can I force the images array to get populated from the server? I assume this is because the artists were already a level deep when they were initially fetched. But I would also assume that by accessing the property the images would be lazy loaded?


I am obviously misinterpreting something here. Thanks in advance for the help smile





Aucun commentaire:

Enregistrer un commentaire