Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit cd18489

Browse files
Fix HMR again following previous change
1 parent 41f1f6f commit cd18489

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

templates/Angular2Spa/ClientApp/boot-client.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ if (hotModuleReplacement) {
1616
enableProdMode();
1717
}
1818

19-
// Boot the application
19+
// Boot the application, either now or when the DOM content is loaded
2020
const platform = platformUniversalDynamic();
21-
document.addEventListener('DOMContentLoaded', () => {
22-
platform.bootstrapModule(AppModule);
23-
});
21+
const bootApplication = () => { platform.bootstrapModule(AppModule); };
22+
if (document.readyState === 'complete') {
23+
bootApplication();
24+
} else {
25+
document.addEventListener('DOMContentLoaded', bootApplication);
26+
}

0 commit comments

Comments
 (0)