32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { ApplicationConfig, importProvidersFrom, provideZoneChangeDetection } from '@angular/core';
|
|
import { provideRouter } from '@angular/router';
|
|
|
|
import { routes } from './app.routes';
|
|
import { HttpClient, provideHttpClient} from '@angular/common/http';
|
|
|
|
|
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
|
|
|
const httpLoaderFactory: (http: HttpClient) => TranslateHttpLoader = (http: HttpClient) =>
|
|
new TranslateHttpLoader(http, './i18n/', '.json');
|
|
// Configuration function for TranslateModule
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
provideZoneChangeDetection({ eventCoalescing: true }),
|
|
provideHttpClient(),
|
|
provideRouter(routes),
|
|
importProvidersFrom([
|
|
TranslateModule.forRoot({
|
|
loader: {
|
|
provide: TranslateLoader,
|
|
useFactory: httpLoaderFactory,
|
|
deps: [ HttpClient ],
|
|
},
|
|
})]), provideAnimationsAsync()
|
|
],
|
|
};
|
|
|