I have an ng change in an input field in html that is associated with a scope variable.
<input type="text" ng-model="test" ng-change="change()" required> var change = function(){ redraw_graph()}
Now, when I change the input field, it redraws the graph for each new character that I write. I want to have a delay (N seconds), so angular will wait until the user completes the input before the ng-change event occurs. And if there are several ng change events, they will undo the earlier ones and only execute the last ones.
I enabled a timeout delay, but after N seconds, the ng-change event still fires more than once. I have solved this problem before, but I canโt figure out how to do it now.
source share