3 import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
4 import { decorateModuleRef } from './app/environment'
5 import { hmrModule } from '@angularclass/hmr'
9 * our top level module that holds all of our components
11 import { AppModule } from './app'
14 * Bootstrap our Angular app with a top level NgModule
16 export function main (): Promise<any> {
17 return platformBrowserDynamic()
18 .bootstrapModule(AppModule)
19 .then(decorateModuleRef)
20 .then((ngModuleRef: any) => {
21 // `module` global ref for webpackhmr
22 // Don't run this in Prod
23 return hmrModule(ngModuleRef, module)
25 .catch((err) => console.error(err))
30 * in prod this is replace for document ready
32 switch (document.readyState) {
34 document.addEventListener('DOMContentLoaded', _domReadyHandler, false)
42 function _domReadyHandler () {
43 document.removeEventListener('DOMContentLoaded', _domReadyHandler, false)