Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

using debounce instead of $timeout for updating the query #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ion-google-place.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ angular.module('ion-google-place', [])
'<div class="bar bar-header item-input-inset">',
'<label class="item-input-wrapper">',
'<i class="icon ion-ios7-search placeholder-icon"></i>',
'<input class="google-place-search" type="search" ng-model="searchQuery" placeholder="' + (attrs.searchPlaceholder || 'Enter an address, place or ZIP code') + '">',
'<input class="google-place-search" ng-model-options="{debounce: 350}" type="search" ng-model="searchQuery" placeholder="' + (attrs.searchPlaceholder || 'Enter an address, place or ZIP code') + '">',
'</label>',
'<button class="button button-clear">',
attrs.labelCancel || 'Cancel',
Expand Down Expand Up @@ -83,7 +83,7 @@ angular.module('ion-google-place', [])
// @TODO: Figure out what to do when the geocoding fails
}
});
}, 350); // we're throttling the input by 350ms to be nice to google's API
}, 0); // we're throttling the input by 350ms to be nice to google's API
});

var onClick = function(e){
Expand Down