Created
May 1, 2012 21:23
-
-
Save meddulla/2571518 to your computer and use it in GitHub Desktop.
Handlebars equal helper
This file contains hidden or 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('eq', function(val, val2, block) { | |
if(val == val2){ | |
return block(this); | |
} | |
}); | |
//Usage in template | |
//{{#eq type "all" }} | |
//<button class="orderer" data-target="sortableAnswers_{{type}}">save order</button> | |
//{{/eq}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
It throws "block is not a function", Please reply as soon as possible