knockout-external-templates /

Filename Size Date modified Message
1.1 KB
703 B


A super-simple external template loader for KnockoutJS.

Loads the template data from the server, rather than looking in <script> tags.


Simplest: just include this file, and it will look for templates at:


If you want to change the settings:

require(['knockout/external-templates'], function(tmpl) {
  tmpl.location = '';
  tmpl.prefix = 'template_'
  tmpl.suffix = '.htm';

  tmpl.notFound = function(name, location) {
    return 'Oops. Could not find ' + name + ' at ' + location';

.location may be a different server, subject to CORS.