我得到ReferenceError: _ is not defined
了角谷歌,地图
我真的不明白为什么会收到此错误,因为我完全按照网站上写的去做。
我也搜索了类似的问题,但没有帮助。
bundle.js
$ = window.$ = window.jQuery = require('./lib/jquery');
require('./lib/angular-simple-logger.js');
require('./lib/angular-google-maps.js');
require('./lib/lodash.js');
我importindbundle.js
进入index.html
。我也尝试使用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
});
});
我也GoogleMaps Api
从启用了Google Developer Console
有人对这个库有一些经验,可以给我提示吗?
您需要添加_下划线库作为依赖项。npm install underscore
,或添加到Bower配置中,或用于依赖管理的任何内容。
<script src="bower_components/underscore/underscore-min.js"></script>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句