Standalone app - auto migrate
This commit is contained in:
@@ -1,12 +1,46 @@
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { enableProdMode, LOCALE_ID, isDevMode, importProvidersFrom } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
|
||||
import { environment } from './environments/environment';
|
||||
import { AppComponent } from './app/app.component';
|
||||
import { ServiceWorkerModule } from '@angular/service-worker';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { AppRoutingModule } from './app/app-routing.module';
|
||||
import { BrowserModule, bootstrapApplication } from '@angular/platform-browser';
|
||||
import { AuthInterceptor } from './app/interceptors/auth.interceptor';
|
||||
import { LoaderInterceptor } from './app/interceptors/loader.interceptor';
|
||||
import { HTTP_INTERCEPTORS, withInterceptorsFromDi, provideHttpClient } from '@angular/common/http';
|
||||
import { MomentDateAdapter, MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular/material-moment-adapter';
|
||||
import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule)
|
||||
bootstrapApplication(AppComponent, {
|
||||
providers: [
|
||||
importProvidersFrom(BrowserModule, AppRoutingModule, ServiceWorkerModule.register('ngsw-worker.js', {
|
||||
enabled: !isDevMode(),
|
||||
// Register the ServiceWorker as soon as the application is stable
|
||||
// or after 30 seconds (whichever comes first).
|
||||
registrationStrategy: 'registerWhenStable:30000'
|
||||
})),
|
||||
{ provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS] },
|
||||
{ provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: true } },
|
||||
{ provide: LOCALE_ID, useValue: 'pl-PL' },
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: LoaderInterceptor,
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: AuthInterceptor,
|
||||
multi: true
|
||||
},
|
||||
provideAnimations(),
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
]
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
||||
Reference in New Issue
Block a user