July 2018
Intermediate to advanced
420 pages
8h 46m
English
Now that we have created the error handling service, we need to refactor our builders and bikes services to use the new error handling.
Open ./app/pages/builders/_services/builder.service.ts and replace its content with the following code:
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams, HttpErrorResponse } from '@angular/common/http';
import { HttpHeaders } from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
// App import
import { environment } from '../../../../environments/environment';
import { Builder } from '../builder';
import { HttpErrorHandler, HandleError } from '../../../shared/_services/http-handle-error.service'; ...Read now
Unlock full access