so if you are using angular 18 or above version then use below changes in app.config.ts file
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideHttpClient()]