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'; import { Routes } from '@angular/router';

53
apps/client/src/main.ts

@ -60,10 +60,28 @@ import { environment } from './environments/environment';
await bootstrapApplication(GfAppComponent, { await bootstrapApplication(GfAppComponent, {
providers: [ providers: [
{ provide: LOCALE_ID, useValue: locale },
authInterceptorProviders, authInterceptorProviders,
httpResponseInterceptorProviders, 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, LanguageService,
ModulePreloadService,
provideAnimations(),
provideHttpClient(withInterceptorsFromDi()), provideHttpClient(withInterceptorsFromDi()),
provideIonicAngular(), provideIonicAngular(),
provideMarkdown(), provideMarkdown(),
@ -73,31 +91,22 @@ import { environment } from './environments/environment';
useClass: CustomDateAdapter, useClass: CustomDateAdapter,
deps: [LanguageService, MAT_DATE_LOCALE, Platform] 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, provide: STRIPE_PUBLISHABLE_KEY,
useFactory: () => environment.stripePublicKey useFactory: () => environment.stripePublicKey
}, },
importProvidersFrom( {
RouterModule.forRoot(routes, { provide: TitleStrategy,
anchorScrolling: 'enabled', useClass: PageTitleStrategy
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 }
] ]
}); });
})(); })();

Loading…
Cancel
Save