forked from TrilonIO/aspnetcore-angular-universal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.browser.ts
22 lines (19 loc) · 945 Bytes
/
main.browser.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import './polyfills/browser.polyfills';
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { BrowserAppModule } from './app/browser-app.module';
const rootElemTagName = 'app'; // Update this if you change your root component selector
// // Enable either Hot Module Reloading or production mode
if (module['hot']) {
module['hot'].accept();
module['hot'].dispose(() => {
// Before restarting the app, we create a new root element and dispose the old one
const oldRootElem = document.querySelector(rootElemTagName);
const newRootElem = document.createElement(rootElemTagName);
oldRootElem.parentNode.insertBefore(newRootElem, oldRootElem);
modulePromise.then(appModule => appModule.destroy());
});
} else {
enableProdMode();
}
const modulePromise = platformBrowserDynamic().bootstrapModule(BrowserAppModule);