aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/main.browser.aot.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/main.browser.aot.ts')
-rw-r--r--client/src/main.browser.aot.ts24
1 files changed, 17 insertions, 7 deletions
diff --git a/client/src/main.browser.aot.ts b/client/src/main.browser.aot.ts
index 29ecf7349..718cb3a80 100644
--- a/client/src/main.browser.aot.ts
+++ b/client/src/main.browser.aot.ts
@@ -1,13 +1,14 @@
1import { platformBrowser } from '@angular/platform-browser'; 1import { platformBrowser } from '@angular/platform-browser';
2import { decorateModuleRef } from './app/environment'; 2import { decorateModuleRef } from './app/environment';
3/* 3
4/**
4 * App Module 5 * App Module
5 * our top level module that holds all of our components 6 * our top level module that holds all of our components.
6 */ 7 */
7import { AppModuleNgFactory } from '../compiled/src/app/app.module.ngfactory'; 8import { AppModuleNgFactory } from '../compiled/src/app/app.module.ngfactory';
8 9
9/* 10/**
10 * Bootstrap our Angular app with a top level NgModule 11 * Bootstrap our Angular app with a top level NgModule.
11 */ 12 */
12export function main(): Promise<any> { 13export function main(): Promise<any> {
13 return platformBrowser() 14 return platformBrowser()
@@ -16,8 +17,17 @@ export function main(): Promise<any> {
16 .catch((err) => console.error(err)); 17 .catch((err) => console.error(err));
17} 18}
18 19
19export function bootstrapDomReady() { 20switch (document.readyState) {
20 document.addEventListener('DOMContentLoaded', main); 21 case 'loading':
22 document.addEventListener('DOMContentLoaded', _domReadyHandler, false);
23 break;
24 case 'interactive':
25 case 'complete':
26 default:
27 main();
21} 28}
22 29
23bootstrapDomReady(); 30function _domReadyHandler() {
31 document.removeEventListener('DOMContentLoaded', _domReadyHandler, false);
32 main();
33}