I have been using handlebars.js for javascript view but have run into a wall with it. I need support for conditionals and nothing I seem to do works.
I have the following block of code:
<select id="status" name="status">
{{#each statuses}}
<option value="{{ this }}"{{#equals userGroup this userGroup.status}} selected="selected"{{/equals}}>{{ this }}</option>
{{/each}}
</select>
I created a helper called equals however it seems like the variable userGroup is not available when within the context of the each.
Does anyone know of any javascript templating engine that supports conditional with if statement to support this kind of functionality (or how to do it in handlebars.js)?
Based on comments in my original question, I am going with underscores template engine (I already use it for other things anyways).