2014-09-05 23 views
0

在我的應用程序,我使用與handlbars插件(https://github.com/SlexAxton/require-handlebars-plugin)requirejs模板,我用我的應用程序集成..把手 - 需要插件引發錯誤...不編譯

但我不斷收到錯誤,我不知道爲什麼?

這裏是我的錯誤:

error screen shot

我需要的配置文件:

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; 
    } 
); 

任何一個可以幫助我解決這問題,請?這吸吮我的時間在這裏!

回答

0

感謝所有...

的問題是,我用bower.js安裝所有我moudles。在插件中,它沒有正確安裝。部分文件從git中丟失。手動我更新和現在加載的車把。