Reputation: 248
res.render('emp-template',employees);
Instead of above code, how can I assign the rendered HTML to a variable.
Upvotes: 2
Views: 1192
Reputation: 111
More specifically
res.render("partials/mail-to-client",(err,html)=>{
console.log(html);
res.json(true);
})
Upvotes: -1
Reputation: 106698
res.render()
accepts an optional callback, which is passed error and html string arguments.
Upvotes: 3