I found the soltion myself.
No need to inject into individual components.
Two things must be done.
app.config.ts
add followingimport { provideHttpClient, withFetch } from '@angular/common/http';
export const appConfig: ApplicationConfig = {providers[provideHttpClient(withFetch())]
appConfig
into bootstaping part at main.ts
import { appConfig } from './app/app.config';
bootstrapApplication(AppComponent, {
...appConfig,
}).catch((err) => console.error(err));