Calling Helper Within If Block in Handlebars Template
问题 I am working with Handlebars.js template engine and am trying to figure out a way to do something like this (contrived example): {{#if itemSelected "SomeItem"}} <div>This was selected</div> {{/if} where itemSelected is a registered helper like this: Handlebars.registerHelper("itemSelected", function(item) { var selected = false; // Lots of logic that determines if item is selected return selected; }); I get errors when trying to use this syntax for the template, and I cannot find any example