vendredi 6 février 2015

How can I get all the images of current slide with hasMany relation in Ember.js?

Model:



App.Slide = App.Imageable.extend


App.Image = App.BaseModel.extend



image_associations: DS.hasMany 'image_association', async: true


View:



App.SliderFullscreenView = Em.CollectionView.extend



content: Em.computed.alias('controller.arrangedContent')


App.SlideFullscreen = Em.View.extend



style: ( ->

console.log(@get('content'))

url = @get('content.picture.url')

return "background-image: url('#{url}');"

).property('content.picture')


My question is, currently I get only 1 image per all slides, but I want total images from first slide. I think I've to change in



SliderFullscreenView's 'content' but I don't know how to do that.



Would anyone please help me?





Aucun commentaire:

Enregistrer un commentaire