I have a demo in which user type anything in input field and request goes to server. Currently whenever user type it fire the request. I want only one request will fire. Example if i type "abc" it fire three request. Is this possible user type anything without stop, after one sec stop I will fire a request.
i know Inputs can be debounced with the ng-model-options directive: but it fire after time given, but i want user type as long as without stop ,but fire request after stop
Here is my code:
http://plnkr.co/edit/npiA2abAo5SEQFMMpKZO?p=preview
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope,$http) {
$scope.name = 'World';
$scope.keyupevt = function(){
console.log('xx')
$http.get("data.json")
.then(function(response) {
console.log(response)
});
}
});