I am trying to pass variables from page.js to page.jade but for some reason this is not working.
here's my code:
page.js
res.render('page', {param1: 'xxx', param2: 'yyy'} );
page.jade
#{param1}
br
#{param2}
br
You might be rendering them as tags instead. View your source html post render.
Try using !{param} instead of #{param}.
Try passing your variables like this
res.render('page', {params: {param1: 'xxx', param2: 'yyy'}});
And inside your template
#{params.param1}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With