Created
April 26, 2012 11:45
-
-
Save appleton/2499061 to your computer and use it in GitHub Desktop.
Conditional comparison for Handlebars
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
Handlebars.registerHelper 'if_equal', (val1, val2, fn) -> | |
if val1 == val2 | |
return fn() | |
else if fn.inverse | |
return fn.inverse() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment