quite new to Javascript and have been on this problem for ages. I am trying to use Google Maps Javascript API to validate an address in a form and I have no idea why it is not working. I have inserted the API reference. I am using Angular Material (if you were wondering about the md stuff)
HTML
<md-input-container>
<input id="pac-input" class="controls" type="text" placeholder="Enter a location">
</md-input-container>
Javascript
function initMap() {
var input = (document.getElementById('pac-input'));
var autocomplete = new google.maps.places.Autocomplete(input);
};
I know the answer must be super easy but you would be helping me a lot!