At the helm, I registered a helper function that returns a list, for example:
function myHelper() {
return [
'some val 1',
'some val 2',
'some val 3'
]
}
I would like to call this function and iterate over the results using Handlebars, something like this:
{{
<li>{{this}}</li>
{{/each}}
However, this does not call my function, I believe that it is looking for a variable in the context myHelper, not a function.
Is there a way to do this or do I need to add the result myHelper()to the context as a variable before the page is displayed?
I use Node, Express and handlebars-express
antfx source
share