我将快照(从数据库中,它是一个对象数组)传递给另一个变量快照,该快照用于手柄模板。我可以使用{{each snaphot}} {{/each}}
遍历快照。如何使用车把访问第一个元素?
app.get("/",function(req, res){
res.render("home", {snapshot: snapshot});
});
//snapshot looks like this
{
{title:"abc",name:"sdc"},
{title:"nbv",name:"kjh"},
{title:"scd",name:"lok"}
}