Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assign precompiled templates to object other than window.Handlebars.templates #361

Closed
biegel opened this issue Nov 9, 2012 · 0 comments
Closed

Comments

@biegel
Copy link

biegel commented Nov 9, 2012

The precompiler always assigns the template function directly to window.Handlebars.templates. This hasn't really been an issue, but it's a persistent roadblock in our attempts to make our front-end apps fully encapsulated. I'm looking for something like:

handlebars userProfile.handlebars -f compiled/userProfile.js --namespace=myApp

Would output:

(function() {
   var template = Handlebars.template, templates = myApp.templates = myApp.templates || {};
templates['userProfile'] = template(function (Handlebars,depth0,helpers,partials,data) {
...
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants