Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cd18489

Browse filesBrowse files
Fix HMR again following previous change
1 parent 41f1f6f commit cd18489
Copy full SHA for cd18489

File tree

Expand file treeCollapse file tree

1 file changed

+7
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-4
lines changed
Open diff view settings
Collapse file

‎templates/Angular2Spa/ClientApp/boot-client.ts‎

Copy file name to clipboardExpand all lines: templates/Angular2Spa/ClientApp/boot-client.ts
+7-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.