Which service use to hit an api? basic angular interview question
Oct 11, 2024
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) { }
}