title: HTTP get call in Angular 6
body: <p>I updated my Angular project to Angular 6 and don't know how to do http get requests. Thats how I did it in Angular 5:</p>
  
  <pre><code>get(chessId: string): Observable&lt;string&gt; {
  
  this.loadingPanelService.text = 'Loading...';
  this.loadingPanelService.isLoading = true;
  
  const url = `${this.apiPathService.getbaseUrl()}api/chess/${chessId}/rating`;   
  
  return this.http.get&lt;string&gt;(url)
  .catch((error) =&gt; {
      console.error('API error: ', error);
  
      this.loadingPanelService.isLoading = false;
      this.notificationService.showErrorMessage(error.message);
  
      return Observable.of(null);
    })
    .share()
    .finally(() =&gt; {
      this.loadingPanelService.isLoading = false;
    });
  </code></pre>
  
  <p>And this is how I'm doing it now. Is that how it is supposed to be done in Angular 6?</p>
  
  <pre><code>...
  return this.http.get&lt;string&gt;(url)
  .pipe(
    catchError(this.handleError),
    share(),
    finalize(() =&gt;{this.loadingPanelService.isLoading = false})
  );
  
  private handleError(error: HttpErrorResponse) {
  console.error('API error: ', error);
  
  this.loadingPanelService.isLoading = false;
  this.notificationService.showErrorMessage(error.message);
  
  // return an observable with a user-facing error message
  return throwError(
    'Something bad happened; please try again later.');
  };
  </code></pre>