I am receiving a google maps place id from rest api. Then I am using the google maps api to get the place object like this:
var geocoder = new google.maps.Geocoder;
geocoder.geocode({
'placeId': data.city
}, function(results, status) {
if (status === google.maps.GeocoderStatus.OK) {
if (results[0]) {
$scope.place = results[0];
} else {
window.alert('No results found');
}
} else {
window.alert('Geocoder failed due to: ' + status);
}
});
I am writing the result inside a scope variable which I am using in the frontend like this:
<label><span>Stadt</span><input type="text" g-places-autocomplete ng-model="place.formatted_address" name="city" class="f-trans"/></label>
I am using kuhnza/angular-google-places-autocomplete from github for the autocomplete function. Somehow now I have got the problem that when the scope variable is set by the function at the top it does not update the input. Only if I click inside the input field and outside of it again it gets updated and the autocomplete function is running without any problem. It does not have to do with the "kuhnza/angular-google-places-autocomplete" tag I am using because if I remove it it still does not work.