【发布时间】:2016-09-10 10:41:35
【问题描述】:
在我的项目中使用 angular-google-places-autocomplete 来自动完成地点
bower install angular-google-places-autocomplete
在控制台中显示错误
Global `google` var missing. Did you forget to include the places API script?
在 index.html 中手动遵循脚本下方包含的 kuhnza/angular-google-places-autocomplete 文档
<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
然后一切正常,但是当移动到生产应用程序时,使用grunt build 构建,然后创建缩小和丑化文件,同样的错误再次出现。
我认为在构建应用程序期间删除了手动添加的脚本。
如何解决这个问题。如何正确地在应用程序中包含这个 google 地方 api。在此先感谢
【问题讨论】:
标签: javascript angularjs google-maps autocomplete gruntjs