title: debounceTime & distinctUntilChanged in angular 6
body: <p>I found some tutorial in rxjs that uses debounce and distinctUntilChanged. How can I implement it in angular 6?</p>
  
  <p>The tutorial code is this:</p>
  
  <pre><code>var observable = Rx.Observable.fromEvent(input,'input');
  
  observable.map(event=&gt;event.target.value)
      .debounceTime(2000)
      .subscribe({
          next:function(value){
          console.log(value)
      }
  }
  </code></pre>
  
  <p>This is my code:</p>
  
  <p>In html, I have this:</p>
  
  <pre><code>&lt;input class="form-control" [(ngModel)]="userQuestion" type="text" name="userQuestion" id="userQuestions"&gt;
  </code></pre>
  
  <p>in Typescript, I have this:</p>
  
  <pre><code>import { Subject,Observable } from "rxjs";
  import { debounceTime,distinctUntilChanged } from "rxjs/operators";
  
  ngOnInit() {
      // initialization
      this.userQuestion = new Observable;
      this.userQuestion.pipe(
          debounceTime(2000)).subscribe(val =&gt; {
              console.log(val)
          }
      )
  }
  </code></pre>
  
  <p>It doesnt work. How can I make it work?</p>