1 year ago
#83947

za stacka2345
How to register Handlebars helper?
I searched the whole internet and no solution works. I have the following helper:
Handlebars.registerHelper('ifeq', function (a, b, options) {
if (a == b) { return options.fn(this); }
return options.inverse(this);
});
I want to use helper in my .hbs file:
{{#ifeq variable "string"}}
... do this ...
{{/ifeq}}
Where do I insert first piece of code, if I want to use that helper in my .hbs file? I've tried various ways, but every time I get the error: "Missing helper: ifeq".
express
helper
express-handlebars
handlebarshelper
0 Answers
Your Answer