mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Rename Angular2Spa to AngularSpa, plus rephrase "Angular 2" as "Angular" in many places
This commit is contained in:
22
templates/AngularSpa/ClientApp/boot-client.ts
Normal file
22
templates/AngularSpa/ClientApp/boot-client.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'reflect-metadata';
|
||||
import 'zone.js';
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { AppModule } from './app/app.module.client';
|
||||
|
||||
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('app');
|
||||
const newRootElem = document.createElement('app');
|
||||
oldRootElem.parentNode.insertBefore(newRootElem, oldRootElem);
|
||||
modulePromise.then(appModule => appModule.destroy());
|
||||
});
|
||||
} else {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
// Note: @ng-tools/webpack looks for the following expression when performing production
|
||||
// builds. Don't change how this line looks, otherwise you may break tree-shaking.
|
||||
const modulePromise = platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
Reference in New Issue
Block a user