1

I am having an issue trying to add a module (angular-google-maps) to Mean.js

I ran:

bower install angular-google-maps --save

Then added 'google-maps' to public/config.js in the applicationModuleVendorDependencies array:

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?

Lkopo
  • 4,798
  • 8
  • 35
  • 60
reubenb87
  • 303
  • 4
  • 11
  • Added this code manually to app\views\layout.server.view.html and it works, just won't add automatically ` ` – reubenb87 Sep 17 '14 at 05:28

1 Answers1

6

Angular-google-maps does not include the google-maps js api. You need to add it manually to your js-libs in config/env/all.js. This is also the place where you can add the lodash and angular-google-maps js files:

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']
    }
}
forrert
  • 4,109
  • 1
  • 26
  • 38
  • Thanks for that, I didn't know about that file, I thought it was automatically scraping the bower packages and adding them somehow! – reubenb87 Oct 06 '14 at 20:44