title: Can't make debounceTime() or throttleTime() to work on an Angular http request
body: <p>For the life of me, I can not make this work.
  I've searched and searched, but I couldn't find any example (all examples out there are with <code>.fromEvent()</code>, none on a <code>http.get</code>).</p>
  
  <p>In my template, I have this input:</p>
  
  <pre><code>&lt;input type="text" (input)="categoriesSearch($event)"&gt;
  </code></pre>
  
  <p>In my component, I have the following:</p>
  
  <pre><code>categoriesSearch(event) {
      this.categoriesSubscription = this.apiService
          .getCategoriesList(this.uploadForm.get('categories').value)
          .debounceTime(3000)
          // .throttleTime(3000)
          .subscribe(
              (response) =&gt; {
                  this.categories = response.data;
              }
          );
  }
  </code></pre>
  
  <p>And this is the method in my ApiService:</p>
  
  <pre><code>getCategoriesList(keyword = null) {
      const headers = new Headers();
      headers.append('Content-Type', 'application/json');
      headers.append('Bearer', this.authService.user.token);
  
      const getParams: URLSearchParams = new URLSearchParams();
      getParams.set('keyword', keyword);
      return this.http.get(this.apiHost + '/categories', { headers: headers, search: getParams })
          .map(response =&gt; response.json());
  }
  </code></pre>
  
  <p>In the <code>categoriesSearch()</code> method, I've tried both <code>debounceTime()</code> and <code>throttleTime()</code> (I also imported them, of course <code>import 'rxjs/add/operator/debounceTime'</code>, <code>import 'rxjs/add/operator/throttleTime'</code>).</p>
  
  <p>But the http.get request is not debounced or throttled at all! If I type 10 characters in 3 seconds, it makes 10 http requests.</p>
  
  <p>How on earth do I tell <code>this.http.get</code> to only make a request if at least 3 seconds have passed since the previous request or since 'no request' (meaning an initial 3 seconds delay)? Ok, maybe here I should say "since I've last typed something in my input".</p>
  
  <p>I've also tried using debounceTime()/throttleTime() in the service directly, before the <code>.map()</code> operator - but the result is the same.</p>