Spaces:
Running
Running
import { bootstrapApplication } from '@angular/platform-browser'; | |
import { provideRouter } from '@angular/router'; | |
import { provideAnimations } from '@angular/platform-browser/animations'; | |
import { provideHttpClient, withInterceptors, HTTP_INTERCEPTORS } from '@angular/common/http'; | |
import { importProvidersFrom } from '@angular/core'; | |
import { AppComponent } from './app/app.component'; | |
import { routes } from './app/app.routes'; | |
import { LoadingInterceptor } from './app/interceptors/loading.interceptor'; | |
bootstrapApplication(AppComponent, { | |
providers: [ | |
provideRouter(routes), | |
provideAnimations(), | |
provideHttpClient(), | |
{ | |
provide: HTTP_INTERCEPTORS, | |
useClass: LoadingInterceptor, | |
multi: true | |
} | |
] | |
}).then(() => { | |
// Uygulama tamamen yüklendiğinde initial loader'ı kaldır | |
const initialLoader = document.querySelector('.initial-loader'); | |
if (initialLoader) { | |
// Smooth transition için biraz bekle | |
setTimeout(() => { | |
initialLoader.classList.add('fade-out'); | |
setTimeout(() => { | |
initialLoader.remove(); | |
}, 300); | |
}, 100); | |
} | |
}).catch(err => { | |
console.error('Bootstrap error:', err); | |
// Hata durumunda da loader'ı kaldır | |
const initialLoader = document.querySelector('.initial-loader'); | |
if (initialLoader) { | |
initialLoader.remove(); | |
} | |
}); |