Answer the question
In order to leave comments, you need to log in
How to set up helpers in webpack handlebars?
Hello. I need to make a condition inside the loop. The example below doesn't work.
{{#each somevar }}
{{#if innNumber === this.inn}}
YES!
{{/if}}
{{/each}}
The innNumber variable is passed when the function is called. this.inn is determined during iteration
As far as I understand, helpers should help me.
Handlebars. registerHelper('if_eq', function(a, b, opts) {
if (a == b) {
return opts. fn(this);
} else {
return opts. inverse(this);
}
});
I connected Handlebars, but here is where to get the Handlebars variable in webpack to set the helper = I don’t understand
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question