Add an HTTP Client
- ✔️Add an Http ClientLearn how to add an HTTP Client to communicate with the fake API server.
The HttpClient module
The HttpClientModule is a built-in Angular module that allows you to make HTTP requests to a server. It provides a HttpClient service that you can inject in your services to make HTTP requests.
🎓 Instructions
-
Import the HttpClientModule in the
src/app/app.module.ts
file. -
Inject the HttpClient service in the
src/app/task.service.ts
file.
✔️ What you learned
The HttpClientModule is a built-in Angular module that allows you to make HTTP requests to a server. That’s one of the first module added in a real-world Angular application to communicate with a server. In the next chapters, we’ll use it to communicate with the fake API server to fetch and update tasks.