89 lines
3.3 KiB
TypeScript
89 lines
3.3 KiB
TypeScript
import { LayoutModule } from '@angular/cdk/layout';
|
|
import { provideHttpClient, withInterceptors } from '@angular/common/http';
|
|
import {
|
|
ApplicationConfig,
|
|
ErrorHandler,
|
|
LOCALE_ID,
|
|
importProvidersFrom,
|
|
isDevMode,
|
|
provideZonelessChangeDetection,
|
|
} from '@angular/core';
|
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
import { LuxonDateAdapter } from '@angular/material-luxon-adapter';
|
|
import { MatButtonModule } from '@angular/material/button';
|
|
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
|
import { MatDialogModule } from '@angular/material/dialog';
|
|
import { MatDividerModule } from '@angular/material/divider';
|
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
import { MatGridListModule } from '@angular/material/grid-list';
|
|
import { MatIconModule } from '@angular/material/icon';
|
|
import { MatInputModule } from '@angular/material/input';
|
|
import { MatMenuModule } from '@angular/material/menu';
|
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
import { MAT_SNACK_BAR_DEFAULT_OPTIONS, MatSnackBarModule } from '@angular/material/snack-bar';
|
|
import { MatSortModule } from '@angular/material/sort';
|
|
import { MatTableModule } from '@angular/material/table';
|
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
import { provideRouter, withComponentInputBinding, withRouterConfig } from '@angular/router';
|
|
import { Settings } from 'luxon';
|
|
|
|
import { dateFormat } from './app.environment';
|
|
import { routes } from './app.routes';
|
|
import { AuthService } from './auth/auth.service';
|
|
import { authInterceptor } from './core/auth.interceptor';
|
|
import { delayInterceptor } from './core/delay-interceptor';
|
|
import { GlobalErrorHandler } from './core/global-error-handler';
|
|
import { httpErrorInterceptor } from './core/http-error.interceptor';
|
|
import { jwtInterceptor } from './core/jwt.interceptor';
|
|
import { refreshInterceptor } from './core/refresh.interceptor';
|
|
|
|
Settings.defaultLocale = 'en-US';
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
importProvidersFrom(
|
|
BrowserModule,
|
|
MatButtonModule,
|
|
MatDialogModule,
|
|
MatDividerModule,
|
|
MatFormFieldModule,
|
|
MatGridListModule,
|
|
MatIconModule,
|
|
MatInputModule,
|
|
MatMenuModule,
|
|
MatSnackBarModule,
|
|
MatToolbarModule,
|
|
LayoutModule,
|
|
ReactiveFormsModule,
|
|
MatTableModule,
|
|
MatPaginatorModule,
|
|
MatSortModule,
|
|
),
|
|
{ provide: LOCALE_ID, useValue: 'en-IN' },
|
|
AuthService,
|
|
provideHttpClient(
|
|
withInterceptors([
|
|
authInterceptor,
|
|
jwtInterceptor,
|
|
refreshInterceptor,
|
|
httpErrorInterceptor,
|
|
...(isDevMode() ? [delayInterceptor] : []),
|
|
]),
|
|
),
|
|
provideRouter(
|
|
routes,
|
|
withRouterConfig({
|
|
onSameUrlNavigation: 'reload',
|
|
}),
|
|
withComponentInputBinding(),
|
|
),
|
|
{ provide: ErrorHandler, useClass: GlobalErrorHandler },
|
|
{ provide: MAT_DATE_LOCALE, useValue: 'en-US' },
|
|
{ provide: DateAdapter, useClass: LuxonDateAdapter, deps: [MAT_DATE_LOCALE] },
|
|
{ provide: MAT_DATE_FORMATS, useValue: dateFormat },
|
|
{ provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, useValue: { duration: 3000 } },
|
|
provideZonelessChangeDetection(),
|
|
],
|
|
};
|