简体   繁体   English

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

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

I am having an issue trying to add a module (angular-google-maps) to Mean.js 我在尝试将模块(angular-google-maps)添加到Mean.js时遇到问题

I ran: 我跑了:

bower install angular-google-maps --save

Then added 'google-maps' to public/config.js in the applicationModuleVendorDependencies array: 然后在applicationModuleVendorDependencies数组中将“ google-maps”添加到public / config.js:

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

But when I try to run (using grunt) I get an error: 但是,当我尝试运行(使用咕)声)时,出现错误:

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.

Is there some other step I need to do? 我还需要执行其他步骤吗? On https://angular-ui.github.io/angular-google-maps/#!/use it says angular-google-maps depends on Lodash, do I have to add this in the module vendor dependencies also? https://angular-ui.github.io/angular-google-maps/#!/上使用,它说angular-google-maps取决于Lodash,是否也必须在模块供应商依赖项中添加它?

Angular-google-maps does not include the google-maps js api. Angular-google-maps不包含google-maps js API。 You need to add it manually to your js-libs in config/env/all.js. 您需要将其手动添加到config / env / all.js中的js库中。 This is also the place where you can add the lodash and angular-google-maps js files: 这也是您可以添加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