import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import {provideRouter, RouteReuseStrategy} from '@angular/router';

import { routes } from './app.routes';
import { provideClientHydration } from '@angular/platform-browser';
import { zh_CN, provideNzI18n } from 'ng-zorro-antd/i18n';
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
import { FormsModule } from '@angular/forms';
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
import {BrowserAnimationsModule, provideAnimations} from '@angular/platform-browser/animations';
import {InitGuardService} from "./utils/initGuard.service";
import {InterceptorService} from "./utils/Interceptor.service";
import {AiRouteReuseStrategy} from "./utils/routeReuseStrategy";

registerLocaleData(zh);

export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    provideClientHydration(),
    provideNzI18n(zh_CN),
    importProvidersFrom(FormsModule),
    importProvidersFrom(HttpClientModule),
    provideAnimations(),
    BrowserAnimationsModule,
    InitGuardService, // 校验登录
    { provide: HTTP_INTERCEPTORS, useClass: InterceptorService, multi: true},
/*    { provide: RouteReuseStrategy, useClass: AiRouteReuseStrategy }*/
  ]
};
