fuse-angular/src/main.ts

40 lines
1.4 KiB
TypeScript
Raw Normal View History

import { importProvidersFrom } from '@angular/core';
import { bootstrapApplication, BrowserModule } from '@angular/platform-browser';
import { provideAnimations } from '@angular/platform-browser/animations';
import { ExtraOptions, PreloadAllModules, RouterModule } from '@angular/router';
import { FuseModule } from '@fuse';
import { FuseMockApiModule } from '@fuse/lib/mock-api';
import { FuseConfigModule } from '@fuse/services/config';
import { AppComponent } from 'app/app.component';
import { appRoutes } from 'app/app.routing';
import { appConfig } from 'app/core/config/app.config';
import { CoreModule } from 'app/core/core.module';
import { LayoutModule } from 'app/layout/layout.module';
import { mockApiServices } from 'app/mock-api';
2021-04-15 14:13:46 +00:00
const routerConfig: ExtraOptions = {
preloadingStrategy : PreloadAllModules,
scrollPositionRestoration: 'enabled',
};
bootstrapApplication(AppComponent, {
providers: [
importProvidersFrom(
BrowserModule,
RouterModule.forRoot(appRoutes, routerConfig),
// Fuse, FuseConfig & FuseMockAPI
FuseModule,
FuseConfigModule.forRoot(appConfig),
FuseMockApiModule.forRoot(mockApiServices),
// Core module of your application
CoreModule,
// Layout module of your application
LayoutModule,
),
provideAnimations(),
],
}).catch(err => console.error(err));