first commit
This commit is contained in:
32
frontend/src/main.ts
Normal file
32
frontend/src/main.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
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));
|
||||
Reference in New Issue
Block a user