Open mkuchtiak opened 3 years ago
The same works well in javascript:
const hb = require('handlebars');
let compiledTemplate = hb.compile("{{#each list as |item|}} {{greeting}} {{/each}}");
hb.registerHelper('greeting', () => {
return "Hello"
});
let output = compiledTemplate({"list": ["hello", "world"]});
console.log(output)
The following test is not working:
when the template is applied, the result is: Hello '' '' rather than Hello 'Hello' 'Hello'
The test works, when the template is changed to: {{greeting}}{{#each list as |item|}} '{{greeting true}}'{{/each}}
So, when no parameters are passed to handlebar helper the helper is not resolved. This is reproducible only when helper is used in a block (e.g. in #each block)
version: com.github.jknack:handlebars:4.2.0