Angular · HTTP · Mid-Level · Code Output
How do you make HTTP calls in Angular?
Short Interview Answer
Inject HttpClient and call get/post/put/delete which return Observables.
Detailed Explanation
Provide HttpClient via provideHttpClient(). Prefer typed responses. Handle errors with catchError. Unsubscribe or use firstValueFrom carefully.
Example
this.http.get<User[]>('/api/users')