I use pug in nodejs and want to pass boolean locals to pug file and if conditions based on this local.
how can I use firstnameProblem on pug file in if condition like blow?
email.js:
email.send({
template: template,
message: { to: 'a@a.com' },
locals: {firstnameProblem:false}
});
html.pug:
ul
if ${firstnameProblem}
li Problem in first name
I found my answer, I can use locals like variable in pug like blow:
html.pug:
ul
if firstnameProblem
li Problem in first name