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 thesrc/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.