Closed 0xgeert closed 10 years ago
One option would be to add the UMD wrapper around the helpers.js
file so it can be served to the browser and hang off of window
, or register with the AMD and Node.js module systems. Do you have that many helpers that you don't want to simply send all the helpers to the client?
Check out browserfy, where you can share modules between the client and server.
Closing this to focus on v1.0 issues. Feel free to continue the conversation though.
Looking for best practice / suggestions to expose handlebars helpers to the client.
crazy idea: I'm thinking of having grunt write a js-file to
public/js
containing all needed helpers client-side. This based on introspecting all handlebars-templates in theshared
folder (as per the advanced example) and looking for used helpers.