Skip to content

Instantly share code, notes, and snippets.

@meddulla
Created May 1, 2012 21:23
Show Gist options
  • Save meddulla/2571518 to your computer and use it in GitHub Desktop.
Save meddulla/2571518 to your computer and use it in GitHub Desktop.
Handlebars equal helper
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}}
@poojathakor
Copy link

Hey,
It throws "block is not a function", Please reply as soon as possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment