How can I get all the images of current slide with hasMany relation?


#1

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?

OK, I came to know that I’ve to set the content

self.controllerFor(‘sliderFullscreen’).set(‘model’, self.store.all(‘slide’))

How can I set content to images here? P. S. slider hasMany images ( polymorphic relation)