Files
itzmineydev/src/app/app.config.ts
T

49 lines
1.5 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 {MARKED_OPTIONS, 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({
markedOptions: {
provide: MARKED_OPTIONS,
useValue: {
breaks: true,
},
},
}),
AuthService,
AuthInterceptor,
importProvidersFrom(
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [HttpClient]
}
})
),
]
};