title: How to SetTimeout KeyUp in Angular 7
body: <p>I've searched solution in Google but not found.</p>
  
  <p><strong>Tried 1:</strong></p>
  
  <pre><code>&lt;input type="text" #txtSearch (keyup)="onKeyUp(txtSearch.value)"&gt;
  </code></pre>
  
  <p>And search.component.ts</p>
  
  <pre><code>onKeyUp(val){
      setTimeout(function(){
          console.log(val);
      },500);
  }
  </code></pre>
  
  <p><strong>Tried 2</strong></p>
  
  <p>I'm using similar here <a href="https://stackoverflow.com/questions/41935424/how-to-achieve-a-debounce-service-on-input-keyup-event-in-angular2-with-rxjs">How to achieve a debounce service on input keyup event in angular2 with rxjs</a> but in Angular 7 not working.</p>
  
  <p><strong>Finally</strong></p>
  
  <p><strong>I expect keyup  delay 0.5s then console.log(value);</strong></p>