Struggling to figure out how to create angular services dynamically. Need help understanding DI and working with the http service.
import { HttpClient } from '@angular/common/http';
export class DynamicService {
constructor(private http: HttpClient) {}
fetchData() {
return this.http.get('/data');
}
}
let dynamicService = new DynamicService(HttpClient);
// encountering issues here.