Using AngularAutoMap you can use Google Places Autocomplete as an angularjs directive.
-
Include the following script in your application https://maps.googleapis.com/maps/api/js?libraries=places
-
Include
angularAutoMap.js
orangularAutoMap.min.js
inside your application. -
Include
autoCompleteAddress
inside your angular module as dependency injection.angular.module('foo', [ 'autoCompleteAddress' ]);
-
To make a text input field map autocomplete field add the attributes below your input field.
google-address-suggestion ng-focus="mv.geolocate()"
Example:
<input id="searchTextField" google-address-suggestion ng-focus="mv.geolocate()" />