Browse Source

Refactoring

pull/5906/head
Thomas Kaul 2 months ago
parent
commit
23075478ae
  1. 2
      apps/client/src/app/app.routes.ts
  2. 53
      apps/client/src/main.ts

2
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';

53
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
}
]
});
})();

Loading…
Cancel
Save