mirror of
https://github.com/bec-project/bec_atlas.git
synced 2025-07-14 07:01:48 +02:00
refactor: cleanup of config init
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
import {
|
||||
APP_INITIALIZER,
|
||||
ApplicationConfig,
|
||||
importProvidersFrom,
|
||||
inject,
|
||||
provideAppInitializer,
|
||||
provideEnvironmentInitializer,
|
||||
provideZoneChangeDetection,
|
||||
} from '@angular/core';
|
||||
@ -20,10 +21,6 @@ import { StarRatingModule } from 'angular-star-rating';
|
||||
import { GridstackComponent } from 'gridstack/dist/angular';
|
||||
import { DeviceBoxComponent } from './device-box/device-box.component';
|
||||
|
||||
const appConfigInitializerFn = (appConfig: AppConfigService) => {
|
||||
return () => appConfig.loadAppConfig();
|
||||
};
|
||||
|
||||
const gridconstructor = () => {
|
||||
GridstackComponent.addComponentToSelectorType([DeviceBoxComponent]);
|
||||
};
|
||||
@ -34,13 +31,11 @@ export const appConfig: ApplicationConfig = {
|
||||
provideRouter(routes),
|
||||
provideAnimationsAsync(),
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideAppInitializer(() => {
|
||||
let appConfigService = inject(AppConfigService);
|
||||
return appConfigService.loadAppConfig();
|
||||
}),
|
||||
AppConfigService,
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: appConfigInitializerFn,
|
||||
deps: [AppConfigService],
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: AuthInterceptor,
|
||||
|
Reference in New Issue
Block a user