how to install express handlebars\ coding
$ npm install express-handlebars
how to install express handlebars\ coding
$ npm install express-handlebars
express handlebars html code
//To output raw HTML instead of escaped HTML use three curly braces instead of two.
//For example:
{{{strong}}}
// Will output the raw HTML from the helper:
strong: function(text) {
return '<strong>' + text + '</strong>';
}
express handlebars
router.get('/list', (req, res) => {
Employee.find((err, docs) => {
if (!err) {
res.render("employee/list", {
list: docs,
});
}
else {
console.log('Error in retrieving employee list :' + err);
}
})**.lean()**; // It is prevent the warning when trying to display records
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us