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

compiling partials as templates #94

Open
unstoppablecarl opened this issue Feb 8, 2014 · 3 comments
Open

compiling partials as templates #94

unstoppablecarl opened this issue Feb 8, 2014 · 3 comments

Comments

@unstoppablecarl
Copy link

Outside of node.js I have always set all my templates to be partials so I can use any template anywhere. I cannot figure out a way to do this with grunt pre-compilation. Is there a way to do this?

@dustinboston
Copy link

You can set partialRegex to /.*/. Only problem I have with that is that if you're using AMD it won't return the instance of Handlebars :-(

@stephanebachelier
Copy link
Contributor

Related to #115

My question is how you would use this partials ?

@realalexhomer
Copy link

If anyone is still wondering, partials exist on the instance of Handlebars you are using, so Handebars.partials.templateName is available when you use {{ > templateName }} within another template.

You can make them available by assigning them like so:

Handlebars.partials.templateName = MyPrecompiledTemplate

However you are defining your precompiled templates.

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

4 participants