33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { HttpClient, provideHttpClient, withInterceptors } from '@angular/common/http';
|
|
import { importProvidersFrom } from '@angular/core';
|
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
import { ConfirmationService, MessageService } from 'primeng/api';
|
|
import { provideRouter } from '@angular/router';
|
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
|
|
import { AppComponent } from './app/app.component';
|
|
import { routes } from './app/app.routes';
|
|
import { authInterceptor } from './app/core/interceptors/auth.interceptor';
|
|
|
|
export function httpLoaderFactory(http: HttpClient) {
|
|
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
|
}
|
|
|
|
bootstrapApplication(AppComponent, {
|
|
providers: [
|
|
provideAnimations(),
|
|
provideHttpClient(withInterceptors([authInterceptor])),
|
|
provideRouter(routes),
|
|
MessageService,
|
|
ConfirmationService,
|
|
importProvidersFrom(
|
|
TranslateModule.forRoot({
|
|
defaultLanguage: 'pl',
|
|
loader: { provide: TranslateLoader, useFactory: httpLoaderFactory, deps: [HttpClient] }
|
|
})
|
|
)
|
|
]
|
|
}).catch((err) => console.error(err));
|