在我的应用程序中,我使用了带有handlbars插件的requirejs (https://github.com/SlexAxton/require-handlebars-plugin),我将其集成到了我的应用程序中。
但是我一直得到一个错误,我不能找出为什么?
下面是我的错误:

我的必需配置文件:
require.config({
baseUrl :'bower_components',
paths: {
"scripts":'../scripts',
"jquery":"jquery/jquery.min",
"underscore" :"underscore-amd/underscore-min",
"backbone" :"backbone-amd/backbone-min",
"marionette":"backbone.marionette/lib/backbone.marionette.min",
"text" : "requirejs-text/text",
"hbs":"require-handlebars-plugin/hbs",
"handlebars":"require-handlebars-plugin/handlebars",
'i18nprecompile' : 'require-handlebars-plugin/hbs/i18nprecompile',
'json2' : 'require-handlebars-plugin/hbs/json2'
},
shim: {
"jquery": {
exports: '$'
},
"underscore":{
exports: '_'
},
"backbone": {
deps: ["jquery","underscore"],
exports: "Backbone"
},
"marionette": {
deps: ["jquery", "underscore", "backbone"],
exports: "Marionette"
}
}
});
require(["scripts/main"]);我的视图文件:
define([
'jquery',
'underscore',
'backbone',
'hbs!../template/login1Template.hbs'],
function ($,_,Bacbone,hbr) {
"use strict";
socialApp = window.socialApp || {};
socialApp.loginView = Bacbone.View.extend({
template:_.template(loginTemplate),
initialize:function(){
var temp = hbr({adjective: "favorite"});
}
});
return socialApp.loginView;
}
);有人能帮我解决这个问题吗?它在吸我的时间!
发布于 2014-09-05 21:24:28
感谢你们所有人。
问题是,我使用bower.js来安装我所有的moudles。在插件中,它没有正确安装。git中缺少某些文件。我手动更新了,现在正在加载车把。
https://stackoverflow.com/questions/25683195
复制相似问题