I am using Kraken.js, dust, mongoose. I have the following object that I get from MongoDB with mongoose.
artist = {
"_id" : ObjectId("xxxxxxxx"),
"first_name" : "myName",
"last_name" : "myLastname",
"description" : "Sample Description here",
"thumbnail" : "thumbnail.jpg",
"works" : [
"art1.jpg",
"art2.jpg"
]
}
The name of the whole model I send to my template is artist (singular).
I want to generate image tag for each member of works.
<img src="art1.jpg" />
<img src="art2.jpg" />
I have tried following snippets and it's not working
{#.}
<img src="./../../images/artists/{.works}" alt="" />
{/.}
{#artist.works}
<img src="./../../images/artists/{.works}" alt="" />
{/.artist.works}
and it prints " "
Genuinely appreciate your help
TL/DR:
artistobject, then you need to iterate theworksobject only.artistobject, then you need to iterate withartist.works.This is the working version of your example.