Skip to content

Instantly share code, notes, and snippets.

@nethoncho
Last active August 29, 2015 14:15
Show Gist options
  • Save nethoncho/824ddf4509ceba75cd2f to your computer and use it in GitHub Desktop.
Save nethoncho/824ddf4509ceba75cd2f to your computer and use it in GitHub Desktop.
angular debounce example
// Example from https://scotch.io/tutorials/making-skinny-angularjs-controllers
// Search the goat database
$scope.searchGoats = _.debounce(function(query) {
$http.get('/goats/search/' + query)
.then(function(response) {
$scope.goats = response.data;
});
}, 300);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment