angular-google-maps , undefined is not a function

混江龙づ霸主 提交于 2019-12-23 04:06:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!