问题
I'm having some issues to put angular-google-maps working on my website.
After include the needed libraries (googleapis/ lodash.js/ angular-google-maps.min.js), I'm unable to configure the app.
I added 'google-maps' to the app module, like this:
var app = angular.module('app', ['iso.directives', 'ngSanitize', 'ui.select', 'facebook', 'google-maps'.ns()]);
And I received, "undefined is not a function" error.
I'm following the tutorial in https://angular-ui.github.io/angular-google-maps/#!/use
I've seen this (.ns() undefined in google angular maps directive) thread, but doesn't help.
Can anyone help me?
Thanks!
回答1:
It looks like they've gotten rid of the ns() function, but haven't updated the documentation yet:
https://github.com/angular-ui/angular-google-maps/pull/872/ https://github.com/angular-ui/angular-google-maps/issues/821
Update all instances of 'string'.ns() to 'uiGmapstring' in your code and you should be good.
来源:https://stackoverflow.com/questions/26867638/angular-google-maps-undefined-is-not-a-function