How to use Handlebars ternary helper?
问题 Following this answer, I wrote a helper like module.exports.register = function (Handlebars) { Handlebars.registerHelper('ternary', function(test, yes, no) { return test ? yes : no; }); }; I'm certain that the helper is loaded and being defined but can't figure out the syntax to use it. I tried using it like <div>{{ternary(true, 'yes', 'no')}}</div> but that gives an assemble build error Warning: Parse error on line 10: ...<div>{{ternary(true, 'yes', ----------^ Expecting 'ID', 'DATA', got