express-handlebars
express-handlebars copied to clipboard
how to access parent variable in #each that in partials?
res.render('index',{
list:[{
color:'red'
},{
color:'white'
}],
name:'tom'
})
//index.hbs
{{#each list}}
{{> template}}
{{/each}}
//template.hbs (in partials dir)
<h5>{{color}} {{../name}}</h5>
//result html
<h5>red</h5>
<h5>white</h5>
//can not access parent value 'tom' \(^o^)/~
Same issue ! did you have any news ?