It appears that I am facing an issue where I cannot access a service injected inside the handleError function.
constructor(private http: HttpClient, public _translate: TranslateService) { }
login(user: User): Observable<User> {
console.log( this._translate); // The service is accessible here
return this.http.post<User>("http://...../login", params, httpOptions)
.pipe(catchError(this.handleError));
}
private handleError(error: HttpErrorResponse) {
console.log( this._translate); // However, the service is not accessible here
return throwError(error.error);
};