Javascript ReferenceError:未定义把手-使用handlebarsJs 2.0.0版时
我正在使用RequireJSV2.1.6加载库,如jquery、jquery mobile、handlebarjs和其他javascript库。我正在使用handlebarsJS 2.0.0版运行时Javascript ReferenceError:未定义把手-使用handlebarsJs 2.0.0版时,javascript,requirejs,handlebars.js,amd,Javascript,Requirejs,Handlebars.js,Amd,我正在使用RequireJSV2.1.6加载库,如jquery、jquery mobile、handlebarjs和其他javascript库。我正在使用handlebarsJS 2.0.0版运行时 paths : { text : 'lib/require/text', jquery : 'lib/jquery/jquery-2.1.1.min', jquerymobile : 'lib/jquery/jquery.mobile-1.4.5.m
paths : {
text : 'lib/require/text',
jquery : 'lib/jquery/jquery-2.1.1.min',
jquerymobile : 'lib/jquery/jquery.mobile-1.4.5.min',
Handlebars : 'lib/handlebars/handlebars.runtime-v2.0.0'
}
加载预编译模板时
var template = Handlebars.templates['loginTemplate'];
我发现了错误
Reference Error: Handlebars is not defined
var template = Handlebars.template, templates = Handlebars.templates = Handlebar...
加载预编译模板的代码是否包装在define中,其中handlebar被指定为依赖项?是的,模板包装在define中&handlebar被指定为依赖项。