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

Error: [$injector:module] Failed to instantiate module uiGmapgoogle-maps due to: Error: [ng:areq] Argument 'fn' is not a function, got string

I've tried to add google-maps-api to my angular js project in the main.js (app.js) file, which now looks like this. Unfortunately I get the above error. I'd really appreciate some guidance, I've spent 3 hours trying to fix this and I just can't figure it out. I'm trying to use the 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'
  });

})


ANSWERS:


I had this same problem today. I was able to fix it by rearranging the order of the js refrences in the my html.

I have them roughly in this order:

<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>

..then my controllers and services.

I used this file as a reference

Hope this helps.



 MORE:


 ? Error: [ng:areq] Argument 'xController' is not a function, got undefined
 ? AngularJs: Error: [ng:areq] Argument 'fn' is not a function, got undefined
 ? Error: [ng:areq] Argument 'meetupsController' is not a function, got undefined
 ? pass function name to function with JSON
 ? pass function name to function with JSON
 ? pass function name to function with JSON
 ? pass function name to function with JSON
 ? how to pass a function name via JSON and call it in javascript/jQuery?
 ? what's the difference between var function and function in javascript?
 ? what's the difference between var function and function in javascript?