diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-11 12:28:22 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-11 12:28:22 +0200 |
commit | 8635a2c70cc24a4c52558162ac058de95750271f (patch) | |
tree | a9699b7c6696218604e6b273b4f34a6898d4f16b /client/src/main.browser.aot.ts | |
parent | 66dd264f7b15c05006faa00694c88c56794edc54 (diff) | |
download | PeerTube-8635a2c70cc24a4c52558162ac058de95750271f.tar.gz PeerTube-8635a2c70cc24a4c52558162ac058de95750271f.tar.zst PeerTube-8635a2c70cc24a4c52558162ac058de95750271f.zip |
Update client modules
Diffstat (limited to 'client/src/main.browser.aot.ts')
-rw-r--r-- | client/src/main.browser.aot.ts | 24 |
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 @@ | |||
1 | import { platformBrowser } from '@angular/platform-browser'; | 1 | import { platformBrowser } from '@angular/platform-browser'; |
2 | import { decorateModuleRef } from './app/environment'; | 2 | import { 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 | */ |
7 | import { AppModuleNgFactory } from '../compiled/src/app/app.module.ngfactory'; | 8 | import { 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 | */ |
12 | export function main(): Promise<any> { | 13 | export 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 | ||
19 | export function bootstrapDomReady() { | 20 | switch (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 | ||
23 | bootstrapDomReady(); | 30 | function _domReadyHandler() { |
31 | document.removeEventListener('DOMContentLoaded', _domReadyHandler, false); | ||
32 | main(); | ||
33 | } | ||