I'd like to pass template data to a "textfield" helper method I have defined, like this:
{{textfield label="{{label}}"
id="account_{{attributes.id}}"
name="account[{{attributes.name}}]"
class="some-class"
required="true"}}
(note the {{label}} and {{attributes.id}} references inside the {{textfield}} helper call)
Here is where I set up the template:
data = {
"attributes": {
"id": "name",
"name": "name"
},
"label": "Name"
}
var templateHtml = 'markup here';
var template = Handlebars.compile(templateHtml);
var formHtml = template(data);
Here is a jsFiddle.
When I run this, I still see {{placeholders}} in the compiled markup.
How can I accomplish this?