我的控制器中有以下代码。
router.get('/', function(req, res, next) {
Appointment.find().then((appointments) => {
console.log(appointments);
res.render('adminappointments', { title: 'Admin-Appointments', appointlink: true, layout: 'adminlayout', appointment: appointments });
}, (err) => {
res.status(400).send(err);
})
});
在我的hbs页面
<tbody>
{{#each appointmentt}}
<tr>
<td>{{this._id}}</td>
<td>{{this.name}}</td>
<td>{{this.email}}</td>
<td>{{this.purpose}}</td>
<td>{{this.clinic}}</td>
<td>{{this.message}}</td>
<td>
<button class="btn btn-small btn-inverse"><i class="icon-trash"></i> Delete</button></td>
</tr>
{{/each}}
</tbody>
该表显示没有数据,但控制台日志显示数据。需要帮助。