title: Angular 6 - Rxjs 6 - Type Observable<Object> is not assignable to type Observable<Item>
body: <p>After updated my Angular project from version 5 to 6 I got this error:</p>
  
  <blockquote>
    <p>Type Observable'&lt;'Object> is not assignable to type Observable'&lt;'Todo>.</p>
  </blockquote>
  
  <p>in my todo.service.ts</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  import { environment } from '../../../environments/environment';
  import { Todo } from '../../../models/Todo';
  import { Observable, of } from 'rxjs';
  import { catchError } from 'rxjs/operators';
  import 'rxjs/add/observable/throw';
  
  @Injectable()
  export class TodoService {
  
    todos: Todo[];
  
    constructor( private httpClient: HttpClient ) { }
  
    loadTodos(): Observable&lt;Todo[]&gt; {
      return this.httpClient.get&lt;Todo[]&gt;(`${environment.api}${environment.path}`).pipe(
        catchError((error: any) =&gt; Observable.throw(error))
      );
    }
  
    addTodo(todo: Todo): Observable&lt;Todo&gt; {
      return this.httpClient.post(`${environment.api}${environment.path}`, JSON.stringify(todo)).pipe(
        catchError((error: any) =&gt; Observable.throw(error))
      );
    }
  
    editTodo(todo: Todo): Observable&lt;Todo&gt; {
      return this.httpClient.put(`${environment.api}${environment.path}/${todo.id}`, JSON.stringify(todo)).pipe(
        catchError((error: any) =&gt; Observable.throw(error))
      );
    }
  
    deleteTodo(todo: Todo): Observable&lt;Todo&gt; {
      return this.httpClient.delete(`${environment.api}${environment.path}/${todo.id}`).pipe(
        catchError((error: any) =&gt; Observable.throw(error))
      );
    }
  }
  </code></pre>
  
  <p>The error points to addTodo, editTodo, and deleteTodo methods, loadTodo has no issues since it assigns Observable'&lt;'Object> type to Observable'&lt;'Array> type.
  I used <a href="https://auth0.com/blog/whats-new-in-rxjs-6/" rel="noreferrer">this link</a> to change the way rxjs elements are imported, but without success. Any help ?</p>