I just updated angular-google-maps via bower to 2.0.1 and added the dependencies required (bluebird,jquery,loadash). When I comment out google-maps, my app works just fine. So it has definitely something to do with angular-google-maps
我刚刚通过bower将angular-google-maps升级到2.0.1,并添加了所需的依赖项(bluebird,jquery,loadash)。当我注释掉谷歌地图时,我的应用程序运行得很好。因此,它肯定与angular-google地图有关。
bower.json dependencies:
鲍尔。json的依赖关系:
"dependencies": {
"angular-route": "~1.2.21",
"angular-sanitize": "~1.2.21",
"angular-strap": "~2.0.5",
"angular-animate": "~1.2.21",
"angular-resource": "~1.2.21",
"underscore": "~1.6.0",
"angular": "~1.2.21",
"jquery": "~2.1.1",
"bootstrap": "~3.2.0",
"angular-bootstrap": "~0.11.0",
"angular-google-maps": "~2.0.1"
}
Here are the libs loaded:
这里是装的libs:
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/underscore/underscore.js"></script>
<script src="/bower_components/lodash/dist/lodash.underscore.min.js"></script>
<script src="/bower_components/bluebird/js/browser/bluebird.js"></script>
<script src="/bower_components/angular/angular.min.js"></script>
<script src="/bower_components/angular-route/angular-route.min.js"></script>
<script src="/bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="/bower_components/angular-resource/angular-resource.min.js"></script>
<script src="/bower_components/angular-animate/angular-animate.min.js"></script>
<script src="/bower_components/angular-google-maps/dist/angular-google-maps.min.js"></script>
<script src="/bower_components/angular-loading-bar/build/loading-bar.min.js"></script>
<script src="/bower_components/angular-bootstrap/ui-bootstrap.min.js"></script>
<script src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
<script src="bower_components/angular-ui-utils/ui-utils.js"></script>
<script src="bower_components/angular-translate/angular-translate.min.js"></script>
<script src="bower_components/angular-dialogs/angular-dialog.min.js"></script>
<script src="/bower_components/angular-i18n/angular-locale_de.js"></script>
Here I load my app:
我在这里加载我的应用:
var app = angular.module('app', [
'ngRoute',
'ngSanitize',
'ngResource',
'ngAnimate',
'google-maps', // when I take this out, my app works...
'angular-loading-bar',
'ui.bootstrap',
'ui.utils',
'AppControllers',
'AppFactories',
'AppDirectives',
]);
app.config(['GoogleMapApiProvider'.ns(), function (GoogleMapApi) {
GoogleMapApi.configure({
key: '*********',
v: '3.17',
libraries: 'weather,geometry,visualization'
});
}]);
The error message I get:
我得到的错误信息是:
Failed to instantiate module app due to:
Error: [$injector:modulerr] http://errors.angularjs.org/1.2.26/$injector/modulerr?p0=...)
at Error (native)
at http://localhost:8000/bower_components/angular/angular.min.js:6:450
at http://localhost:8000/bower_components/angular/angular.min.js:34:97
at r (http://localhost:8000/bower_components/angular/angular.min.js:7:290)
at e (http://localhost:8000/bower_components/angular/angular.min.js:33:207)
at http://localhost:8000/bower_components/angular/angular.min.js:33:284
at r (http://localhost:8000/bower_components/angular/angular.min.js:7:290)
at e (http://localhost:8000/bower_components/angular/angular.min.js:33:207)
at gc (http://localhost:8000/bower_components/angular/angular.min.js:36:309)
at c (http://localhost:8000/bower_components/angular/angular.min.js:18:170
I really don't know what breaks the module, I have checked my bower links, updated all dependencies (bower update).
我真的不知道是什么破坏了这个模块,我检查了我的bower链接,更新了所有依赖(bower update)。
I have been at it to try and find the mistake, but without luck. Maybe someone can help me here. Thanks!
我一直在试图找出错误,但没有运气。也许有人能帮我一下。谢谢!
2 个解决方案
#1
2
They changed module name so update it:
他们更改了模块名,所以更新了:
var app = angular.module('app', [
'ngRoute',
'ngSanitize',
'ngResource',
'ngAnimate',
'google-maps'.ns(), // new namespace
'angular-loading-bar',
'ui.bootstrap',
'ui.utils',
'AppControllers',
'AppFactories',
'AppDirectives',
]);
as update in point 4. https://angular-ui.github.io/angular-google-maps/#!/use
作为第4点的更新。使用https://angular-ui.github.io/angular-google-maps/ # ! /
#2
0
var app = angular.module('app', ['uiGmapgoogle-maps']);
#1
2
They changed module name so update it:
他们更改了模块名,所以更新了:
var app = angular.module('app', [
'ngRoute',
'ngSanitize',
'ngResource',
'ngAnimate',
'google-maps'.ns(), // new namespace
'angular-loading-bar',
'ui.bootstrap',
'ui.utils',
'AppControllers',
'AppFactories',
'AppDirectives',
]);
as update in point 4. https://angular-ui.github.io/angular-google-maps/#!/use
作为第4点的更新。使用https://angular-ui.github.io/angular-google-maps/ # ! /
#2
0
var app = angular.module('app', ['uiGmapgoogle-maps']);