繁体   English   中英

将Angular-Google-Maps添加到Mean.js

[英]Adding Angular-Google-Maps to Mean.js

我在尝试将模块(angular-google-maps)添加到Mean.js时遇到问题

我跑了:

bower install angular-google-maps --save

然后在applicationModuleVendorDependencies数组中将“ google-maps”添加到public / config.js:

var applicationModuleVendorDependencies = ['ngResource', 'ngAnimate', 'ui.router', 'ui.bootstrap', 'ui.utils', 'google-maps'];

但是,当我尝试运行(使用咕)声)时,出现错误:

Error: [$injector:nomod] Module 'google-maps' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

我还需要执行其他步骤吗? https://angular-ui.github.io/angular-google-maps/#!/上使用,它说angular-google-maps取决于Lodash,是否也必须在模块供应商依赖项中添加它?

Angular-google-maps不包含google-maps js API。 您需要将其手动添加到config / env / all.js中的js库中。 这也是您可以添加lodash和angular-google-maps js文件的地方:

assets: {
    lib: {
        js: [
            '//maps.googleapis.com/maps/api/js?sensor=false',
            'public/lib/lodash/dist/lodash.underscore.js',
            'public/lib/angular-google-maps/dist/angular-google-maps.js']
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM