Dinoop mathew
Dinoop mathew

Reputation: 248

How to get rendered HTML using handlebar express?

 res.render('emp-template',employees);

Instead of above code, how can I assign the rendered HTML to a variable.

Upvotes: 2

Views: 1192

Answers (2)

PatricioS
PatricioS

Reputation: 111

More specifically



    res.render("partials/mail-to-client",(err,html)=>{
      console.log(html);
      res.json(true);
    })


Upvotes: -1

mscdex
mscdex

Reputation: 106698

res.render() accepts an optional callback, which is passed error and html string arguments.

Upvotes: 3

Related Questions