【发布时间】:2018-04-08 23:29:00
【问题描述】:
我正在尝试使用 Angular mongo 和节点(咖啡脚本和猫鼬)开发一个网站。我从 mongo db 获得了一些数据库值,但我需要将数据显示到 pug 模板引擎中
这里是代码
init: =>
@Sign
.find()
.then (result) =>
@scope.sign = result.data
.catch (err) =>
console.log err
@scope.sign 是 Json 对象 .. 我需要显示从 Json 对象到哈巴狗的一列元素(“产品名称”).. 有人请帮帮我
【问题讨论】:
-
JSON 是什么格式?你能举一个 JSON 的例子吗?
-
{ _id: 59f2fcbca65e3f39a309473f, createdAt: 2017-10-27T09:30:36.357Z, updatedAt: 2017-10-27T09:34:48.828Z, name: 'machan peru madhure', __v: 0 , priceunit: 'USD', price: '20000', holdtime: '90', slot: '9', address: '位置或地址', resolution: '920px', width: '100', height: '100' }
-
使用:result.data中的每个产品>>>>p= product.name
标签: angularjs node.js mongoose coffeescript pug