I made a template helper called "$" within my Marionette setup
templateHelpers:function(){
return jQuery.extend(this,{
'$':function (text){
return Handlebars.compile('{{'+text+'}}')(this);
}
});
},
this allows me to do this
{{$ collection.display}}
which will resolve collection.display, typically to name, but may be some other field name like service_id, and then my handler will resolve that. So I have indirection, and cheaper than typing
{{{{collection.display}}}}
All good. The only snag is, when I stick it inside an {{#each items}} loop,
{{#each items}}
<option value="{{this.id}}">{{$ ../collection.display}} </option>
{{/each}}
it blows up with
Error: Missing helper: "$"
Note that it doesnt matter what I put after $ when inside the block {{$ anything}} will fail, the helper is just not there.