0

我正在尝试将 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但我遇到了问题。有人可以对此作出回应。

4

1 回答 1

1

看起来google-maps依赖关系没有正确包含在控制器中DashboardCtrl

controller("DashboardCtrl", ["$scope", "$cookies", "$location", "google-maps",  
        function($scope, $cookies, $location) {

你能删除依赖吗

controller("DashboardCtrl", ["$scope", "$cookies", "$location",  
        function($scope, $cookies, $location) {
于 2014-08-19T05:50:19.987 回答