Skip to content

Instantly share code, notes, and snippets.

@ifandelse
Created August 15, 2011 14:26
Show Gist options
  • Save ifandelse/1146858 to your computer and use it in GitHub Desktop.
Save ifandelse/1146858 to your computer and use it in GitHub Desktop.
How to use the Knockout.js-External-Template-Engine to Eager Load Templates
var tmplEagerLoad = [ "customer", "user", "search", "about", "orders" ];
// This will cause the templates to be requested and cached locally
// in script blocks for KO to pick up like any normal embedded template
tmpl.EagerLoad.forEach(function(template) {
ko.externaljQueryTemplateEngine.getTemplateNode(template);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment