res.render('emp-template',employees);
如何将渲染的 HTML 分配给变量,而不是上面的代码。
最佳答案
res.render()
接受一个可选的回调,该回调传递错误和 html 字符串参数。
关于node.js - 如何使用handlebar express获取渲染的HTML?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27358602/
res.render('emp-template',employees);
如何将渲染的 HTML 分配给变量,而不是上面的代码。
最佳答案
res.render()
接受一个可选的回调,该回调传递错误和 html 字符串参数。
关于node.js - 如何使用handlebar express获取渲染的HTML?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27358602/
相关文章:
javascript - 事件.js :85 throw er;//Unhandled 'error' event
javascript - 如何在nodejs中使用异步 map 系列?
namespaces - 在 Node.js 中修改 'global' 对象
javascript - 如何从 app.js 处理 Express 4/nodejs 中的获取/发布,将数据从表单传递到显示结果的新页面
javascript - 外部文件中的 ExpressJS 导出路由不适用于根路径
javascript - HTML 表单提交(POST req)到服务器应返回动态 HTML
node.js - winston - TypeError : winston. createLogger 不是构造函数
mysql - 类型错误 : Cannot read property 'filename' of undefined--multer