Jade Iterations and variables
I'm trying to learn jade using express on nodejs.
I'm passing an array of objects to the index by
res.render('index', {
title : '**'
, skills : [
{ type: '**', desc: '**' }
, { type: '**', desc: '**' }
, { type: '**', desc: '**' }
]
} )
That I want to iterate in a jade file, so I did :
.skills
each skill in #{skills}
div
label #{skill.type}
label #{skill.desc}
But it doesn't work, I've tried tones of things but I still cannot make it work. Can anyone help ?
I'm trying to learn jade using express on nodejs.
I'm passing an array of objects to the index by
res.render('index', {
title : '**'
, skills : [
{ type: '**', desc: '**' }
, { type: '**', desc: '**' }
, { type: '**', desc: '**' }
]
} )
That I want to iterate in a jade file, so I did :
.skills
each skill in #{skills}
div
label #{skill.type}
label #{skill.desc}
But it doesn't work, I've tried tones of things but I still cannot make it work. Can anyone help ?
No comments:
Post a Comment