Import des sources angular à partir de 'headup_app'
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { APP_INITIALIZER, ApplicationConfig, LOCALE_ID } from '@angular/core';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
//import { provideRouter, withComponentInputBinding, withDebugTracing } from '@angular/router';
|
||||
import { provideRouter, withViewTransitions } from '@angular/router';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { provideHttpClient, withInterceptors } from '@angular/common/http';
|
||||
import { registerLocaleData } from '@angular/common';
|
||||
import localeFr from '@angular/common/locales/fr';
|
||||
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
|
||||
import { EMPTY } from "rxjs";
|
||||
|
||||
registerLocaleData(localeFr);
|
||||
|
||||
import { routes } from './app.routes';
|
||||
import { apiInterceptor, tokenInterceptor, errorInterceptor } from "src/app/core/interceptors";
|
||||
import { JwtService, UserService } from "src/app/core/services";
|
||||
|
||||
export function initAuth(jwtService: JwtService, userService: UserService) {
|
||||
return () => (jwtService.getToken() ? userService.getCurrentUser() : EMPTY);
|
||||
}
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
//provideRouter(routes, withComponentInputBinding(), withDebugTracing()),
|
||||
provideRouter(routes, withViewTransitions()),
|
||||
provideHttpClient(
|
||||
withInterceptors([apiInterceptor, tokenInterceptor, errorInterceptor])
|
||||
),
|
||||
provideAnimations(),
|
||||
provideCharts(withDefaultRegisterables()),
|
||||
Title,
|
||||
{ provide: LOCALE_ID, useValue: 'fr-FR' },
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: initAuth,
|
||||
deps: [JwtService, UserService],
|
||||
multi: true,
|
||||
}
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user