mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
In the update to Angular 4, the bootstrap import got removed from boot.client.ts, causing the navbar-toggle menu to longer work in the template. Re-adding so navbar-toggle is functional again.
24 lines
958 B
TypeScript
24 lines
958 B
TypeScript
import 'reflect-metadata';
|
|
import 'zone.js';
|
|
import 'bootstrap';
|
|
import { enableProdMode } from '@angular/core';
|
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
import { AppModule } from './app/app.module.browser';
|
|
|
|
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);
|