0
我有下面的代碼,但我仍然得到以下錯誤,當templates.js負載:使用車把與不加載預編譯模板
Uncaught ReferenceError: Handlebars is not defined
這裏是我如何加載所需的腳本(第一車把,那麼預編譯tempaltes):
var scripts = [
'//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.3/handlebars.min.
js'
, '/templates/templates.js'
];
$.each(scripts, function(i, script){
var el = document.createElement('script');
el.src = script;
$body.append(el);
});
但在控制檯中我得到這個錯誤:
Uncaught ReferenceError: Handlebars is not defined
handlbebars不會requirejs開箱工作使用那些js文件以相同的順序。我不想使用補丁版本的把手。我將probalby溝Handlbars altother作爲它在現實世界中很大程度上無法使用。 – chovy 2013-04-22 04:53:40
@chovy您可以使用填充配置選項並導出「把手」。 – 2014-05-15 04:45:23