2016-04-02 14 views
0

この質問は約100回尋ねられますが、このエラーが発生しています。スクリーンショットを確認してください。角2エラー:SyntaxError:予期しないトークン<

Error: SyntaxError: Unexpected token < at Object.eval (http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/date-formatter.js:2:14) at eval (http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/date-formatter.js:13:4) Evaluating http://localhost:3000/moment Evaluating http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/date-formatter.js Evaluating http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker-inner.js Evaluating http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker.js Evaluating http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker-popup.js Evaluating http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker.js Evaluating http://localhost:3000/node_modules/ng2-bootstrap/ng2-bootstrap.js Error loading http://localhost:3000/app/main.js

私は、システムの設定

System.config({ 
     packages: { 
      app: { 
      format: 'register', 
      defaultExtension: 'js' 
      }, 
      'ng2-bootstrap': { 
      defaultExtension: 'js' 
      } 
     }, 
     map: { 
      // place for ng2 modules mapping 
      'ng2-bootstrap': 'node_modules/ng2-bootstrap' 
     } 
}); 

を固定しますが、このソリューションの後、私はエラーを取得していますし、ページがロードされていないために与えられているソリューションを追った...

誰もが知っていますそれに従ってください私に教えてください。

+2

「この質問は約100回尋ねられます」.... –

+0

datepickerformatterのコードを掲載してください – KnowHoper

答えて

0

実際、ng2-boostrapはバンドルされたファイルを提供しました。単にscript要素にそれを追加し、SystemJSの関連する構成を削除します。

<script src="node_modules/ng2-bootstrap/bundles/ng2-bootstrap.js"></script> 

System.config({ 
    packages: { 
     app: { 
     format: 'register', 
     defaultExtension: 'js' 
     }, 
     'ng2-bootstrap': { 
     defaultExtension: 'js' 
     } 
    }, 
    map: { 
     // place for ng2 modules mapping 
     'ng2-bootstrap': 'node_modules/ng2-bootstrap' 
    } 
}); 

これは、NPMとNG2-ブートストラップのインストール後に行うことができます。

関連する問題