Angular 4, How to update [(ngModel)] with a delay of 1 seconds
问题 Since ngModel is updating instantly how to put a delay. <input type="text" value="{{item.task_name}}" name="task_name" [(ngModel)]="item.task_name" (ngModelChange)="update_fields([item.task_name])" > I need to save the task_name with a delay of one seconds by calling update_fields() , To avoid instant calls to service. Thanks 回答1: Rxjs and Observables are the perfect candidate for this type of task! Here is an example of how it can be achieved: Template: <input type="text" [value]="item.task