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
Handlebar pre compiled is still slow #1215
Comments
Your HTML is atrocious. The reason for the slowdown cannot be addressed without your view model. |
This is the context <script type="text/javascript">
var array = [];
for (i = 0; i < 3; i++) {
var src = "img/arrow_ + i + .png";
array.push(src);
}
var context = {"array":array}
var theCompiledHtml = Handlebars.templates['events.tmpl'](context);
$('.render').html(theCompiledHtml);
</script> |
I'm not sure what your function in the script tags are for; appears to be for iterating over an array of images, but the code I pasted in for calling your precompiled template doesn't belong there. Ideally, you'd have a single app file with your template calls, telling the page where to output the rendered HTML. Right now, I think what I'm seeing will result in your precompiled template being fully evaluated by the browser, before rendering. This makes precompiling worthless. |
Closing due to inactivity. |
I'm using phonegap with handlebars but even if I precompiled the templates is still slow.
Maybe putting a script inside a template is causing this.
The text was updated successfully, but these errors were encountered: