Closed cbou closed 1 year ago
@cbou is this in regards to this gem, or you mean on the javascript side.
The javascript of handlebars.js is here: http://handlebarsjs.com/reference.html
you should be able to do Handlebars.registerHelper('name', func)
I means in this gems yes.
When I use //= require handlebars.runtime
, I don't have the chance to inject helpers before it's compile right?
@cbou it is actually possible to inject by overriding:
I am not sure if there is any documentation about this feature, but it is in there (alpha).
@AlexRiedler I'm trying to add a server-side helper I'm using in my js
via Handlebars.registerHelper
. Any code example to implement the above on first load?
Thanks
@mattberridge finally got around to it: https://github.com/AlexRiedler/hbs_examples/tree/helper-example
this is without the additional optimization of knownHelpers
I didn't find any way to include helpers when using the handlebars.runtime.