2015-11-04 8 views
5

角度-グーグルマップを使用しながら、_が定義されていない私は、私はこのエラーを取得していますなぜ私はそれが正確に何をやっているので、私は本当に、理解していないReferenceError: _ is not definedangular-google-mapsがにReferenceError:

を取得していますウェブサイトに書かれています。

また、同様の質問を検索しましたが、助けにはなりませんでした。

bundle.js

$ = window.$ = window.jQuery = require('./lib/jquery'); 
require('./lib/angular-simple-logger.js'); 
require('./lib/angular-google-maps.js'); 
require('./lib/lodash.js'); 

私はindex.htmlbundle.js importindです。私もngLodashを使用しようとしましたが、結果は出ませんでした。

app.js

var app = angular.module('app', [ 
    'ngLodash', 
    'nemLogging', 
    'uiGmapgoogle-maps' 
]); 

app.config(function(uiGmapGoogleMapApiProvider) { 
    uiGmapGoogleMapApiProvider.configure({ 
     key: '{myKey}', 
     v: '3.20', 
     libraries: 'places' // I don't need the whole map, only the places 
    }); 
}); 

はまた、私は誰かがこのライブラリといくつかの経験を持っていますし、私にヒントを与えることができますGoogle Developer Console

からGoogleMaps Apiを有効に?

答えて

5

依存関係として_ underscoreライブラリを追加する必要があります。 npm install underscore、またはbower設定に追加するか、依存している管理に使用するものを追加してください。

<script src="bower_components/underscore/underscore-min.js"></script> 
+0

私は同じ問題に直面しています。私はmavenを使用して依存関係としてアンダースコアを追加しましたが、同じエラーが発生しました。誰も助けてくれますか? – Sategroup

関連する問題