我正在尝试将google-maps添加到我的模块中,但我遇到了这个问题 - 错误:[$ injector:unpr]以及类似的结尾 -
angular.module("app", ["google-maps"])
angular.module("app.controllers", ["ngCookies"]).controller("AppCtrl", ["$scope", "$location", "$cookies",
function($scope, $location, $cookies) {
return $scope.isSpecificPage = function() {
}, $scope.main = {
}
}
}]).controller("DashboardCtrl", ["$scope", "$cookies", "$location", "google-maps",
function($scope, $cookies, $location) {
return $scope.map = {
center: {
latitude: 45,
longitude: -73
},
zoom: 8
};
}])
我遵循这个,就像把文件放在同一个顺序 - https://angular-ui.github.io/angular-google-maps/#!/use但我遇到了问题。有人可以回复此事。
答案 0 :(得分:1)
在控制器google-maps
DashboardCtrl
依赖项
controller("DashboardCtrl", ["$scope", "$cookies", "$location", "google-maps",
function($scope, $cookies, $location) {
请你删除依赖
controller("DashboardCtrl", ["$scope", "$cookies", "$location",
function($scope, $cookies, $location) {