mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 03:53:02 +00:00
[DURACOM-234] Switch to standalone bootstrapping API
This commit is contained in:
@@ -3,15 +3,17 @@ import 'reflect-metadata';
|
||||
import 'core-js/es/reflect';
|
||||
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
|
||||
import { AppComponent } from './app/app.component';
|
||||
import { AppConfig } from './config/app-config.interface';
|
||||
import { extendEnvironmentWithAppConfig } from './config/config.util';
|
||||
import { environment } from './environments/environment';
|
||||
import { BrowserAppModule } from './modules/app/browser-app.module';
|
||||
import { browserAppConfig } from './modules/app/browser-app.config';
|
||||
|
||||
const bootstrap = () => platformBrowserDynamic()
|
||||
.bootstrapModule(BrowserAppModule, {});
|
||||
/*const bootstrap = () => platformBrowserDynamic()
|
||||
.bootstrapModule(BrowserAppModule, {});*/
|
||||
const bootstrap = () => bootstrapApplication(AppComponent, browserAppConfig);
|
||||
|
||||
/**
|
||||
* We use this to determine have been serven SSR HTML or not.
|
||||
@@ -33,9 +35,9 @@ const main = () => {
|
||||
// Configuration must be fetched explicitly
|
||||
return fetch('assets/config.json')
|
||||
.then((response) => response.json())
|
||||
.then((appConfig: AppConfig) => {
|
||||
.then((config: AppConfig) => {
|
||||
// extend environment with app config for browser when not prerendered
|
||||
extendEnvironmentWithAppConfig(environment, appConfig);
|
||||
extendEnvironmentWithAppConfig(environment, config);
|
||||
return bootstrap();
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user