I precompiled my handlebars template like this:
handlebars tabs.hbs -f tabs.js
I load them like this:
<script type="text/javascript" src="js/handlebars.runtime.min.js"></script>
<script type="text/javascript" src="js/templates/tabs.js"></script>
<script type="text/javascript" src="js/tabsData.js"></script>
This is how I provide the context to the precompiled template:
var template=Handlebars.templates["tabs.hbs"];
var html=template(tabsData);
console.log(html)
sidebar.setContent(html);
I get this error:
Uncaught TypeError: undefined is not a function handlebars.runtime.js 436
/*Error points here*/
var result = templateSpec.call(
container,
namespace, context,
helpers,
partials,
options.data);
This is template
:
function (context, options) {
options = options || {};
var namespace = options.partial ? options : env,
helpers,
partials;
if (!options.partial) {
helpers = options.helpers;
partials = options.partials;
}
var result = templateSpec.call(
container,
namespace, context,
helpers,
partials,
options.data);
if (!options.partial) {
env.VM.checkRevision(container.compilerInfo);
}
return result;
}