node express handlebars 循环遍历
发布于 10 年前 作者 youarenode 7634 次预览 最后一次回复是 10 年前 来自 问答
request(‘http://xxxxxxxxxx.com/API.php’, function(error, response, body){ if(!error && response.statusCode == 200){ var data = JSON.parse(body); var noviceName = data.data.lists.novice[‘Name’];
res.render('home', {
noviceName : noviceName,
node : 'v0.12.7'
});
}
});
我从后端API用node 拿过来的json数据 怎么给handlebars上无法循环遍历?
5 回复
错误是什么?
@leapon 没错误 但是我不能每个json属性都解出来再给 handlebars 吧? 我给到handlebars一个json对象 他不可以each 遍历吗?
@youarenode
遍历对象的属性
看了下 handlebars 知道了 还不熟 谢谢