Files
codiki-hexagonal/frontend/src/app/app.config.ts
Florian THIERRY - Takiguchi 0cce8b2982
Some checks failed
Build and Deploy Java Gradle Application / build-and-deploy (push) Failing after 53s
Fixing Angular 21 by migrating all values by signals. (#11)
2026-02-03 15:07:55 +01:00

28 lines
1.1 KiB
TypeScript

import {ApplicationConfig, inject, provideAppInitializer} from '@angular/core';
import {provideRouter, withRouterConfig} from '@angular/router';
import {HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
import {provideAnimationsAsync} from '@angular/platform-browser/animations/async';
import {routes} from './app.routes';
import {JwtInterceptor} from './core/interceptor/jwt.interceptor';
import {AuthenticationService} from './core/service/authentication.service';
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(
routes,
withRouterConfig({
paramsInheritanceStrategy: 'always',
onSameUrlNavigation: 'reload'
})
),
provideAnimationsAsync(),
provideHttpClient(withInterceptorsFromDi()),
{provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true},
provideAppInitializer(() => {
const initializerFn = ((authenticationService: AuthenticationService) => () => authenticationService.startAuthenticationCheckingProcess())(inject(AuthenticationService));
return initializerFn();
})
]
};