2014-02-28 1 views
1

저는 Yeoman을 처음 접했고 공식 백본 생성기를 사용하여 새 프로젝트를 준비 중입니다. 나는 명령을 사용하여 jQuery를 모바일을 추가했습니다 : 나는 응용 프로그램을 실행하면Yeoman 백본 프로젝트에 jQuery Mobile 추가

bower install -save jquery-mobile 

모든 누락 된 내 JQuery와 모바일 스크립트의 보고서를 require.js. 이 herehere에 대한 게시물을 읽었습니다. 나는 한 걸음도 놓치고 있거나 main.js가 잘못 설정되어 있어야합니다. 여기

내 main.js의 관련 부분은 다음과 같습니다

require.config({ 
    shim: { 
     <...> 
     jquerymobileconfig: { 
     deps: [ 
      'jquery' 
     ] 
     }, 
     jquerymobile: { 
     deps: [ 
      'jquery', 
      'jquerymobileconfig' 
     ] 
     } 
    }, 
    paths: { 
    jquery: '../bower_components/jquery/jquery', 
    jquerymobileconfig: 'jqmconfig', 
    jquerymobile: '../bower_components/jquery-mobile/js/jquery.mobile', 
    backbone: '../bower_components/backbone/backbone', 
    underscore: '../bower_components/underscore/underscore' 
    } 
}); 

require([ 
    'jquery', 'backbone', 'jquerymobile' 
], function ($, Backbone) { 
    Backbone.history.start(); 
}); 

답변

1

내가 내 질문에 here에 대한 답을 발견했다. 대신 이물 JQuery와 모바일 프로젝트를 설치하는 설치 : 이물/보좌관 프로젝트 JQuery와 모바일 버전을 갈 수있는 준비가되어

bower install -save jquery-mobile-bower 

합니다. main.js의 jquery mobile을 다음과 같이 참조하십시오.

jquerymobile: '../bower_components/jquery-mobile-bower/js/jquery.mobile-1.4.1.min',