I'm getting ReferenceError: _ is not defined
the angular-google-maps
I don't really understand why I'm getting this error, because I'm doing exactly what it is written on the website.
Also I searched for similar questions, but they didn't helped.
bundle.js
$ = window.$ = window.jQuery = require('./lib/jquery');
require('./lib/angular-simple-logger.js');
require('./lib/angular-google-maps.js');
require('./lib/lodash.js');
I'm importind bundle.js
into the index.html
. I also tried to use ngLodash
, but no results.
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
});
});
Also I enabled the GoogleMaps Api
from the Google Developer Console
Does someone have some experience with this library and can give me a hint?
You need to add the _ underscore library as a dependency. npm install underscore
, or add to your bower config, or whatever you use for dependecy management.
<script src="bower_components/underscore/underscore-min.js"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With