ngAutocomplete
ngAutocomplete copied to clipboard
types not defined in getPlace()
trafficstars
When the watchEnter option is set to true, getPlace is used to get the location. However the types parameter is not included in the request and will therefore not return the same results as the autocomplete list.
In my example this resulted in street addresses being included in the result (I had defined types: '(cities)' in my options).
It can be fixed by adding the types parameter to the request as follows (around line 124 in ngAutocomplete):
autocompleteService.getPlacePredictions(
{
input: result.name,
offset: result.name.length,
types: opts.types
},