Forked from niksumeiko/handlebars.helpers.ifEquals.js
Created
April 2, 2020 07:17
Handlebars.js templates engine custom IF condition helper. Allows to compare values one to each other like you are used to in programming.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compares first value to the second one allowing entering IF clouse if true. | |
// Otherwise entering ELSE clause if exist. | |
Handlebars.registerHelper('ifEquals', function(a, b, options) { | |
if (a === b) { | |
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