【发布时间】:2016-11-15 15:40:43
【问题描述】:
我正在尝试将一组对象发送到玉,以对其进行渲染。我无法使用 Jade 渲染它。 在 node.js 中,我查询数据库并从数据库中检索几个文档,然后将这些文档 (JSON) 放入对象数组 (dataarray) 中。
dataarray = [];
dataarray[i] = dbdocument;
我想在 node.js 的 get 方法中将数据数组传递给 Jade
res.render('index', {
title: 'Image Analysis - this is the content of the database',
dbdoc: dataarray
});
在 Jade 中,我尝试了几种编码方法,但均未成功。 我要做的是将数据数组呈现为 Jade 中的表 像这样 .....
tbody
tr
td= 1
td= dataarray.ImageID
有什么建议如何将 Jade 中的数据数组呈现为表格?
【问题讨论】: