Can\'t seem to google up an example of how this is done.
I have successfully created a textbox that calls a function every time it changes. What I would like to do is o
For angular approach can inject $timeout
in controller as dependency and use $watch
on scope variable you've assigned in ng-model
.
var timer=false;
$scope.ModelName='foo';
$scope.$watch('ModelName', function(){
if(timer){
$timeout.cancel(timer)
}
timer= $timeout(function(){
/* run code*/
},delay)
});