From 23075478aec94df7a2a42a6d7780c7ef269df0c3 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 5 Nov 2025 19:50:54 +0100 Subject: [PATCH] Refactoring --- apps/client/src/app/app.routes.ts | 2 +- apps/client/src/main.ts | 53 ++++++++++++++++++------------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/apps/client/src/app/app.routes.ts b/apps/client/src/app/app.routes.ts index ace605ee1..9588cee68 100644 --- a/apps/client/src/app/app.routes.ts +++ b/apps/client/src/app/app.routes.ts @@ -1,4 +1,4 @@ -import { publicRoutes, internalRoutes } from '@ghostfolio/common/routes/routes'; +import { internalRoutes, publicRoutes } from '@ghostfolio/common/routes/routes'; import { Routes } from '@angular/router'; diff --git a/apps/client/src/main.ts b/apps/client/src/main.ts index 8a5ee59ab..c5e0f3869 100644 --- a/apps/client/src/main.ts +++ b/apps/client/src/main.ts @@ -60,10 +60,28 @@ import { environment } from './environments/environment'; await bootstrapApplication(GfAppComponent, { providers: [ - { provide: LOCALE_ID, useValue: locale }, authInterceptorProviders, httpResponseInterceptorProviders, + importProvidersFrom( + GfNotificationModule, + MatAutocompleteModule, + MatNativeDateModule, + MatSnackBarModule, + MatTooltipModule, + NgxStripeModule.forRoot(environment.stripePublicKey), + RouterModule.forRoot(routes, { + anchorScrolling: 'enabled', + preloadingStrategy: ModulePreloadService, + scrollPositionRestoration: 'top' + }), + ServiceWorkerModule.register('ngsw-worker.js', { + enabled: environment.production, + registrationStrategy: 'registerImmediately' + }) + ), LanguageService, + ModulePreloadService, + provideAnimations(), provideHttpClient(withInterceptorsFromDi()), provideIonicAngular(), provideMarkdown(), @@ -73,31 +91,22 @@ import { environment } from './environments/environment'; useClass: CustomDateAdapter, deps: [LanguageService, MAT_DATE_LOCALE, Platform] }, - { provide: MAT_DATE_FORMATS, useValue: DateFormats }, + { + provide: LOCALE_ID, + useValue: locale + }, + { + provide: MAT_DATE_FORMATS, + useValue: DateFormats + }, { provide: STRIPE_PUBLISHABLE_KEY, useFactory: () => environment.stripePublicKey }, - importProvidersFrom( - RouterModule.forRoot(routes, { - anchorScrolling: 'enabled', - preloadingStrategy: ModulePreloadService, - scrollPositionRestoration: 'top' - }), - GfNotificationModule, - MatAutocompleteModule, - MatNativeDateModule, - MatSnackBarModule, - MatTooltipModule, - NgxStripeModule.forRoot(environment.stripePublicKey), - ServiceWorkerModule.register('ngsw-worker.js', { - enabled: environment.production, - registrationStrategy: 'registerImmediately' - }) - ), - provideAnimations(), - ModulePreloadService, - { provide: TitleStrategy, useClass: PageTitleStrategy } + { + provide: TitleStrategy, + useClass: PageTitleStrategy + } ] }); })();