Last active
August 29, 2015 14:15
-
-
Save nethoncho/824ddf4509ceba75cd2f to your computer and use it in GitHub Desktop.
angular debounce example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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