Home:ALL Converter>Angular 6 rxjs timeout - timeout is not a function

Angular 6 rxjs timeout - timeout is not a function

Ask Time:2018-11-28T05:13:22         Author:ProgSky

Json Formatter

I am trying to use timeout in one of my http post. I get error as

ERROR TypeError: this._http.post(...).timeout is not a function

This is how the code looks like:

return this._http.post(this.meetingProcessURL, body )
  .timeout(5000)
  .catch( err => { 
    return Observable.throw("Timeout has occurred");
  })

    .pipe(catchError(this.handleError));
  }

I am using angular 6 and rxjs 6.0.0

"@angular/core": "^6.1.0",
"rxjs": "^6.0.0",
"rxjs-compat": "^6.0.0",

What am I doing wrong?

ref: Angular 2 rxjs timeout callback

enter image description here

Author:ProgSky,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/53508217/angular-6-rxjs-timeout-timeout-is-not-a-function
yy