ngAutocomplete icon indicating copy to clipboard operation
ngAutocomplete copied to clipboard

types not defined in getPlace()

Open dnlmzw opened this issue 10 years ago • 0 comments
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
},

dnlmzw avatar Feb 26 '15 12:02 dnlmzw