February 2019
Intermediate to advanced
446 pages
10h 55m
English
All our REST calls will be made through this service. It will also manage the logged-in (current user). You can see that we have also created a mock object that contains the list of restaurants. Mock data is used, when the API gateway or other services are down.
However, once the API gateway and other apps are up, no data should be read from the mock object. You can check the browser console logs to trace it. Also, you may want to modify the error handling blocks to properly handle the calls:
import { Injectable, Output, EventEmitter } from '@angular/core';import { Router } from '@angular/router';import { HttpClient } from '@angular/common/http';import { map, catchError } from 'rxjs/operators'; ...Read now
Unlock full access