42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import {ApplicationConfig, importProvidersFrom, provideZoneChangeDetection} from '@angular/core';
|
|
import {provideRouter, withInMemoryScrolling, withViewTransitions} from '@angular/router';
|
|
import {routes} from './app.routes';
|
|
import {provideClientHydration, withEventReplay} from '@angular/platform-browser';
|
|
import {HttpClient, provideHttpClient} from '@angular/common/http';
|
|
import {AuthService} from './shared/services/auth.service';
|
|
import {AuthInterceptor} from './auth.interceptor';
|
|
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
|
|
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
|
|
import { provideMarkdown } from 'ngx-markdown';
|
|
|
|
export function createTranslateLoader(http: HttpClient) {
|
|
return new TranslateHttpLoader(http, '/i18n/', '.json');
|
|
}
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
provideZoneChangeDetection({ eventCoalescing: true }),
|
|
provideRouter(routes,
|
|
withViewTransitions(),
|
|
withInMemoryScrolling({
|
|
scrollPositionRestoration: 'top',
|
|
anchorScrolling: 'enabled'
|
|
})
|
|
),
|
|
provideClientHydration(withEventReplay()),
|
|
provideHttpClient(),
|
|
provideMarkdown(),
|
|
AuthService,
|
|
AuthInterceptor,
|
|
importProvidersFrom(
|
|
TranslateModule.forRoot({
|
|
loader: {
|
|
provide: TranslateLoader,
|
|
useFactory: createTranslateLoader,
|
|
deps: [HttpClient]
|
|
}
|
|
})
|
|
),
|
|
]
|
|
};
|