Hi all, i have started a new project and struggle with the angular standalone components in ionic.
I just want to have HttpClient, so i have seen that i have to import provideHttpClient and put it in the providers. But when i do, it tells me, that it’s not assignable to ‘Provider’.
What am i doing wrong?
You can add provideHttpClient()
to the providers array of the bootstrapApplication
in your main.ts
bootstrapApplication(AppComponent, {
providers: [
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
importProvidersFrom(IonicModule.forRoot({})),
provideHttpClient(),
provideRouter(routes),
],
});
2 Likes
it worked. thanks man