Seeking assistance in AngularJS to clear the textbox value upon triggering the google map autocomplete event. Can anyone provide guidance?
Here is the HTML code -
<input ng-model="deployText" id="search_execute" class="form-control" type="text" placeholder="Enter locations">
Below is the JavaScript code inside Controller function -
var autocomplete = new google.maps.places.Autocomplete($("#search_execute")[0], {types: ['(cities)']});
google.maps.event.addListener(autocomplete, 'place_changed', function() {
var place = autocomplete.getPlace();
angular.element(document.getElementById('execute_place')).append("<div style='float:left'>"+place.address_components[0].long_name+"</div>");
$scope.execute.push({latitude:place.geometry.location.lat(), longitude:place.geometry.location.lng()});
$scope.deployText = ""; //I need help with clearing the text
});