Friday 15 April 2011

AngularJS Error: [ng:areq] Argument 'fn' is not a function, got string with Google Maps SDK Async Loader -



AngularJS Error: [ng:areq] Argument 'fn' is not a function, got string with Google Maps SDK Async Loader -

error: [$injector:module] failed instantiate module uigmapgoogle-maps due to: error: [ng:areq] argument 'fn' not function, got string

i've tried add together google-maps-api angular js project in main.js (app.js) file, looks this. unfortunately above error. i'd appreciate guidance, i've spent 3 hours trying prepare , can't figure out. i'm trying utilize sdk async loader instead of .

angular .module('sfevendorapp', [ 'nganimate', 'ngcookies', 'ngresource', 'ngroute', 'ngsanitize', 'ngtouch', ['google-maps'.ns()] ]) .config(['googlemapapiprovider'.ns()], function ($routeprovider, googlemapapi) { googlemapapi.configure({ key: 'aizasycxxliqe_baty18opp79tfol5ck40xqyp8', v: '3.17', libraries: 'weather,geometry,visualization' }); $routeprovider .when('/login', { templateurl: 'views/login.html', controller: 'loginctrl' }) .when('/openshop', { templateurl: 'views/openshop.html', controller: 'openshopctrl' }) .when('/about', { templateurl: 'views/about.html', controller: 'aboutctrl' }) .otherwise({ redirectto: '/login' }); })

i had same problem today. able prepare rearranging order of js refrences in html.

i have them in order:

<script src="path/bluebird.js"></script> <script src="path/jquery.min.js"></script> <script src="path/angular.js"></script> <script src="path/lodash.min.js"></script> <script src="path/angular-google-maps.js"></script>

..then controllers , services.

i used file reference https://github.com/angular-ui/angular-google-maps/blob/master/example/example.html

hope helps.

angularjs google-maps

No comments:

Post a Comment