Skip to content

Instantly share code, notes, and snippets.

@nataliefl
Created April 6, 2016 13:00
Show Gist options
  • Save nataliefl/25f92e1d991a9261443fffdb1eaf0c13 to your computer and use it in GitHub Desktop.
Save nataliefl/25f92e1d991a9261443fffdb1eaf0c13 to your computer and use it in GitHub Desktop.
ifnoteq
/**
* If not equal
* {{#ifnoteq "valueA" "valueB"}} ... {{else}} ... {{/if}}
*/
Handlebars.registerHelper('ifnoteq', function ifnoteq(a, b, opts) {
return (a != b) ? opts.fn(this) : opts.inverse(this);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment