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

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

Since ngModel is updating instantly how to put a delay.

  

        
6条回答
  •  情书的邮戳
    2021-02-05 16:23

    update_fields(){
    
      this.service.yourTask(){
        .subscribe(data => {
          setTimeout(()=>{ //your task }, 4000)
        }    
      }
    }
    
    
    someFunction() {
        setTimeout(() => /* code to execute */, 3000)
    }
    

提交回复
热议问题