From 83b0c10c1e4b31dba2353409c7f029921f308756 Mon Sep 17 00:00:00 2001 From: James Gambrell Date: Fri, 29 Apr 2016 13:31:49 -0500 Subject: [PATCH] Adding types parameter the getPlacesPrediction call that is used when the watchEnter parameter is true. This makes sure that the autoselected first index is the same as the displayed autocomplete results. --- src/ngAutocomplete.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ngAutocomplete.js b/src/ngAutocomplete.js index 3b0b33c..c902047 100644 --- a/src/ngAutocomplete.js +++ b/src/ngAutocomplete.js @@ -110,7 +110,8 @@ angular.module( "ngAutocomplete", []) autocompleteService.getPlacePredictions( { input: result.name, - offset: result.name.length + offset: result.name.length, + types: [scope.options.types] }, function listentoresult(list, status) { if(list == null || list.length == 0) { @@ -163,4 +164,4 @@ angular.module( "ngAutocomplete", []) } }; - }); \ No newline at end of file + });