Is it possible to pass a JavaScript object/hash into a Handlebars helper call? I\'d like to do something like this:
{{#
I found another best way to pass objects.
Template:
{{textField dataAttribs='{"text":"Hello", "class": "text-field"}'}}
Helper:
Handlebars.registerHelper('textField', function(options) {
var attribs;
attribs = JSON.parse(options.hash.dataAttribs);
console.log(attribs.text + " -- " + attribs.class);
......
........
});
JSFiddle for this