Is there a way to debounce the template directive (ngModelChange)
?
Or, alternatively, what is the least-painful way to do it a different way?
The closest answer I see is this: How to watch for form changes in Angular 2?
So, for example, I have a text input, I want to get onChange updates, but I want to debounce it down from every keystroke:
<input type="text" class="form-control" placeholder="Enter a value" name="foo" [(ngModel)]="input.event.value" (ngModelChange)="onFieldChange($event, input)">
Debounce onFieldChange()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…