I am using Angular v16 and I have the following config that needs to be included in app.module. What is the best way to inject appConfig in app.module? It works if I include them directly inside app.module providers, but I want to manage all the dependencies in a separate config file.
Note: I'm not using standalone component for app.component.ts. So I can't use bootstrapApplication to to inject them
app.config.ts
export const appConfig: ApplicationConfig = {
providers: [
provideAnimations(),
provideHttpClient(),
provideRouter(
appRoutes,
withInMemoryScrolling({scrollPositionRestoration: 'enabled'}),
),
]
}
main.ts
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch((err) => console.error(err));