Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Handlebars Helpers
Handlebars.registerHelper('ifgt', function (val1, val2, options) {
if (val1 > val2) {
return options.fn(this);
}
return options.inverse(this);
});
Handlebars.registerHelper('iflt', function (val1, val2, options) {
if (val1 < val2) {
return options.fn(this);
}
return options.inverse(this);
});
Handlebars.registerHelper('ifeq', function (val1, val2, options) {
if (val1 == val2) {
return options.fn(this);
}
return options.inverse(this);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment