Reputation: 1791
i have screenShots element in my document that is an array of URLs which am trying to display in the front-end. here is my code
<div class="col-md-4">
{{#each product.screenShots}}
<img src="{{product.screenShots}}" alt="">
{{/each}}
</div>
this is what i get int he client side.
i can see the images exists when i enter the URLs. what am i doing wrong here?
Upvotes: 0
Views: 30
Reputation: 2677
Since you said, screenshots
is an array of URLs, you need to change src
attribute like this,
<div class="col-md-4">
{{#each product.screenShots}}
<!-- Assuming product.screenShots = ["http://url-to-image1.com", "http://url-to-image2.com"] and so on..
<img src="{{this}}" alt="">
{{/each}}
</div>
Upvotes: 2