Hello I try to load the google maps api asynchronously in AngularJS following this link:http://angular-ui.github.io/angular-google-maps/#!/
I get the following error:
Error: [$injector:modulerr] Failed to instantiate module due to:
[$injector:modulerr] Failed to instantiate module RegisterClientModule due to:
undefined is not an object (evaluating 'uiGmapGoogleMapApiProvider.configure')
my code(Please note: I just started with AngularJS 2-3 days ago, I guess my mistake is easy to fix once I fully understand why this is not working):
var module = angular.module('RegisterClientModule', [])
.config(['$routeProvider', function config($routeProvider,uiGmapGoogleMapApiProvider) {
$routeProvider.when('/registerclient', {
controller: 'RegisterClientController',
templateUrl: '/scripts/modules/RegisterClientModule/registerClientView.html'
});
uiGmapGoogleMapApiProvider.configure({
v: '3.17',
libraries: 'weather,geometry,visualization'
});
}]);
module.controller('RegisterClientController', ['$scope', function($scope, uiGmapGoogleMapApi ) {
uiGmapGoogleMapApi.then(function(maps) {
console.log("Google maps api loaded");
});
$scope.map = { center: { latitude: 45, longitude: -73 }, zoom: 8 };
console.log("Google maps api provider:"+uiGmapGoogleMapApi );
}]);
Thanks for your help