49 lines
1.6 KiB
TypeScript
49 lines
1.6 KiB
TypeScript
import {ApplicationConfig, importProvidersFrom, provideZoneChangeDetection} from '@angular/core';
|
|
import {provideRouter, withInMemoryScrolling, withViewTransitions} from '@angular/router';
|
|
import {routes} from './app.routes';
|
|
import {provideClientHydration, withEventReplay, withNoIncrementalHydration} from '@angular/platform-browser';
|
|
import {HttpClient, provideHttpClient, withXhr} 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(), withNoIncrementalHydration()),
|
|
provideHttpClient(withXhr()),
|
|
provideMarkdown({
|
|
markedOptions: {
|
|
provide: MARKED_OPTIONS,
|
|
useValue: {
|
|
breaks: true,
|
|
},
|
|
},
|
|
}),
|
|
AuthService,
|
|
AuthInterceptor,
|
|
importProvidersFrom(
|
|
TranslateModule.forRoot({
|
|
loader: {
|
|
provide: TranslateLoader,
|
|
useFactory: createTranslateLoader,
|
|
deps: [HttpClient]
|
|
}
|
|
})
|
|
),
|
|
]
|
|
};
|