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

Usage example for --simple precompilation option #166

Open
giles-v opened this issue Dec 6, 2016 · 0 comments
Open

Usage example for --simple precompilation option #166

giles-v opened this issue Dec 6, 2016 · 0 comments

Comments

@giles-v
Copy link

giles-v commented Dec 6, 2016

Using the --simple precompilation flag outputs an object with a main function like this:

{"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
    [snip]
},"usePartial":true,"useData":true}

It's not clear how templates precompiled in this manner should be loaded or rendered. The docs say:

If using the simple mode the precompiler will generate a single javascript method. To execute this method it must be passed to the Handlebars.template method and the resulting object may be used as normal.

But this file does not contain a single method. Should I be passing templateObj.main to the Handlebars.template method and ignoring the other object properties? An example would really help here.

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

1 participant