37 lines
1.6 KiB
TypeScript
37 lines
1.6 KiB
TypeScript
import {ApplicationConfig, inject, provideAppInitializer, provideZoneChangeDetection} from '@angular/core';
|
|
import {provideRouter} from '@angular/router';
|
|
|
|
import {routes} from './app.routes';
|
|
import {provideClientHydration} from '@angular/platform-browser';
|
|
import {HTTP_INTERCEPTORS, provideHttpClient, withFetch, withInterceptorsFromDi} from "@angular/common/http";
|
|
import {provideAnimationsAsync} from '@angular/platform-browser/animations/async';
|
|
import {provideMomentDateAdapter} from "@angular/material-moment-adapter";
|
|
import {MAT_SNACK_BAR_DEFAULT_OPTIONS} from "@angular/material/snack-bar";
|
|
import {AuthGuard} from "./authentication/authguard";
|
|
import {TokenInterceptor} from "./authentication/tokenInterceptor";
|
|
import {ErrorInterceptor} from "./authentication/errorInterceptor";
|
|
import {provideNgxMask} from "ngx-mask";
|
|
import {UserService} from './authentication/user.service';
|
|
import {provideAnimations} from "@angular/platform-browser/animations";
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
provideAppInitializer(() => {
|
|
const userService = inject(UserService);
|
|
userService.initializeUser();
|
|
}),
|
|
provideZoneChangeDetection({eventCoalescing: true}),
|
|
provideRouter(routes),
|
|
provideClientHydration(),
|
|
provideHttpClient(withFetch(), withInterceptorsFromDi()),
|
|
provideAnimations(),
|
|
provideMomentDateAdapter(undefined, {useUtc: false}),
|
|
{ provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, useValue: { duration: 2500}},
|
|
AuthGuard,
|
|
{ provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true },
|
|
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
|
|
provideNgxMask(),
|
|
]
|
|
};
|
|
|