Search code examples
angularangular-httpclient

timeoutWith operator Angular 5 Httpcleint


just startting to upgrade angular 2.0.0 to 5.2.0 . So i'm using HttpClient . I want to use timeoutWith operator on httpClient.get(). All i get is Property 'timeoutWith' does not exist on type 'Observable<Object>'.

someFunction(){
 let someUrl = '.../../' ;
return this._httpClient.get(url).timeoutWith(1000,this.throwTimeout()).catch(this.handleError);

}

What am i doing wrong ? this was working with the previous httpmodule

Thanks


Solution

  • Just add :

    import 'rxjs/add/operator/timeoutWith';