kuhnza / angular-google-places-autocomplete

Pure AngularJS directive for Google Places Autocomplete
MIT License
257 stars 189 forks source link

How to check in controller that specific prediction is clicked or not? #130

Open rangrasjay opened 5 years ago

rangrasjay commented 5 years ago

Suppose we are using: <input class="form-control" g-places-autocomplete ng-model="place" ng-enter="myFunc(place)"/>

myFunc is the function in the controller which will use geoCode API. My issue is, I am not able to identify from where 'enter' was clicked. For example, If I am typing an address and receiving predictions and what happening is both functions are been called, one from the directive and other from the ng-enter.

How I would be able to check whether enter key was pressed from prediction or from prediction?