Angular 4, How to update [(ngModel)] with a delay of 1 seconds

前端 未结 6 1624
攒了一身酷
攒了一身酷 2021-02-05 16:17

Since ngModel is updating instantly how to put a delay.

  

        
6条回答
  •  难免孤独
    2021-02-05 16:38

    Add delay inside your update_fields() method.

    Like:

    public update_fields(data)
      setTimeout(function() {
       //call service
      }, 1000);
    

提交回复
热议问题