mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Previously, the state `script` was always appended as the last item in the `body` tag. This can result in the state not being available when the Angular application is bootstrap.
A workaround for this was to delay the bootstrapping of the application until by using the `DOMContentLoaded` event listener.
```ts
const bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule);
document.addEventListener('DOMContentLoaded', bootstrap);
```
With this change the above workaround is no longer necessary as the state `script` tag is now added prior of any other `script` which guarantees that the state is present prior of the Angular application is bootstrapped.
PR Close #48868
|
||
|---|---|---|
| .. | ||
| domino_adapter.ts | ||
| http.ts | ||
| location.ts | ||
| platform-server.ts | ||
| platform_state.ts | ||
| private_export.ts | ||
| server.ts | ||
| server_events.ts | ||
| server_renderer.ts | ||
| styles_host.ts | ||
| tokens.ts | ||
| transfer_state.ts | ||
| types.d.ts | ||
| utils.ts | ||
| version.ts | ||