Files
syscom-master-admin-ui/src/app/app.config.ts
T

32 lines
1.3 KiB
TypeScript

import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import { provideRouter, withRouterConfig, RouteReuseStrategy } from '@angular/router';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import { App_Route } from './app.routes';
import { ToastrModule } from 'ngx-toastr';
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
import { authInterceptor } from './core/interceptors/auth.interceptor';
import { errorInterceptor } from './core/interceptors/error.interceptor';
import { loadingInterceptor } from './core/interceptors/loading-interceptor';
import { ReloadRouteReuseStrategy } from './core/strategies/reload-route-reuse.strategy';
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(App_Route, withRouterConfig({ onSameUrlNavigation: 'reload' })),
{ provide: RouteReuseStrategy, useClass: ReloadRouteReuseStrategy },
provideHttpClient(withInterceptors([authInterceptor, errorInterceptor,loadingInterceptor])),
provideAnimations(),
provideCharts(withDefaultRegisterables()),
importProvidersFrom(
ToastrModule.forRoot({
timeOut: 1500,
closeButton: true,
progressBar: true,
}),
),
],
};