July 2019
Intermediate to advanced
416 pages
10h 6m
English
We have covered one side of the client/server interaction. It's now time for us to address the other side—the code that actually calls the routes that our server exposes. Not surprisingly, we add a service that takes care of this communication. We start with the code to create the service:
ng g service services/TransferData
Our service is going to make use of three things. The first thing that it will rely on is an HttpClient instance to manage the get and post operations. We also bring in the AddImageService and LoadImageService classes that we have just created:
export class TransferDataService { constructor(private client: HttpClient, private addImage: AddImageService, private loadImage: LoadImageService) { }}
Read now
Unlock full access