Files
perfdb/pdb-js/src/main.ts

49 lines
2.2 KiB
TypeScript

import { enableProdMode, importProvidersFrom } from '@angular/core';
import { environment } from './environments/environment';
import { MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { MarkdownModule } from 'ngx-markdown';
import { bootstrapApplication } from '@angular/platform-browser';
import { provideAnimations } from '@angular/platform-browser/animations';
import { AppComponent } from './app/app.component';
import { provideRouter, Routes, withDebugTracing } from '@angular/router';
if (environment.production) {
enableProdMode();
}
(<any>window).randomId = () => {
return Math.random().toString(36).replace('0.', '') + Math.random().toString(36).replace('0.', '');
};
(<any>window).submitterId = (<any>window).randomId();
const routes: Routes = [
{ path: "", loadComponent: () => import("./app/main-page/main-page.component").then( m => m.MainPageComponent) },
{ path: "vis", loadComponent: () => import("./app/visualization-page/visualization-page.component").then(m => m.VisualizationPageComponent) },
{ path: "dashboard", loadComponent: () => import("./app/dashboard-page/dashboard-page.component").then(m => m.DashboardPageComponent) },
{ path: "dashboard/:id", loadComponent: () => import("./app/dashboard-page/dashboard/dashboard.component").then(m => m.DashboardComponent) },
{ path: "upload", loadComponent: () => import("./app/upload-page/upload-page.component").then(m => m.UploadPageComponent) },
{ path: "grid", loadComponent: () => import("./app/customizable-grid/customizable-grid.component").then(m => m.CustomizableGridComponent) },
{ path: "help", loadComponent: () => import("./app/help-page/help-page.component").then(m => m.HelpPageComponent) },
];
bootstrapApplication(AppComponent, {
providers: [
provideRouter(routes, withDebugTracing()),
importProvidersFrom(
MarkdownModule.forRoot(),
),
{
provide: MAT_DIALOG_DEFAULT_OPTIONS,
useValue: { hasBackdrop: true },
},
provideHttpClient(withInterceptorsFromDi()),
provideAnimations()
]
})
.catch(err => console.error(err));