I am currently integrating Google Maps API into my app for location selection. I have included the following script:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=places&language=en-US"></script>
While this setup is functional in a local environment, it encounters an issue when implemented in my main application.
ReferenceError: google is not defined angular.js:13294
at HTMLDocument.<anonymous> (VM6558 locator.js:87)
at fire (jquery.js:3187)
at Object.self.add [as done] (jquery.js:3246)
at jQuery.fn.ready (jquery.js:3496)
at Object.<anonymous> (VM6558 locator.js:86)
at Object.invoke (angular.js:4625)
at Object.enforcedReturnValue [as $get] (angular.js:4464)
at Object.invoke (angular.js:4625)
at angular.js:4424
The sequence of scripts is as follows:
<link rel="stylesheet" href="libs/bootstrap/dist/css/bootstrap.min.css"/>
<script type="text/javascript" src="libs/jquery/dist/jquery.min.js"> </script>
<script type="text/javascript" src="libs/jquery-ui/jquery-ui.min.js"></script>
<link rel="stylesheet" href="/public/libs/jquery-ui/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=places&language=en-US"></script>
<script src="libs/angular/angular.js"></script>
<script src="libs/angular-route/angular-route.js"></script>
<script src="libs/angular-animate/angular-animate.js"></script>