templateHelpers not working in pug engine
Closed this issue · 1 comments
rajusubramaniam commented
I have this code in NodeJS.
jsreport.render({
template: {
content: 'h1 Hello #{templateHelpers.foo()}',
helpers: { foo: () => { return 'world' } },
engine: 'pug',
recipe: 'chrome-pdf'
},
data: {
},
}).then((out) => {
out.stream.pipe(res);
}).catch((e) => {
res.end(e.message);
});
I tried various combinations and could not get visibility of the helper method 'foo'. Am I missing something?
Error while executing templating engine. templateHelpers.foo is not a function on line 1
pofider commented
Please don't create duplicated issues. Thank you.