Which service use to hit an api? basic angular interview question

Anil Kumar
Oct 11, 2024

--

Photo by Courtney Cook on Unsplash

for hit an api we use http client service from http Client module

import { HttpClient} from '@angular/common/http';

export class ApiService {
private apiUrl = 'https://api.example.com/data';

constructor(private httpService: HttpClient) { }
}

--

--