Angular: Avoid having to put the client bootstrap in DOMContentLoaded for TransferState to work properly

Created on 16 Nov 2017  ·  1Comment  ·  Source: angular/angular

Currently the client of a SSR Angular app needs to wait for DOMContentLoaded to complete before bootstrapping so that TransferState can reliably get the contents of the transferred state from the DOM.

Need to investigate whether we can handle this more transparently without the user needing to bootstrap in a specific way on the client side.

server feature

Most helpful comment

@vikerman do you suggest doing something like this?

document.addEventListener('DOMContentLoaded', () => {
  platformBrowserDynamic().bootstrapModule(AppModule);
});

>All comments

@vikerman do you suggest doing something like this?

document.addEventListener('DOMContentLoaded', () => {
  platformBrowserDynamic().bootstrapModule(AppModule);
});
Was this page helpful?
0 / 5 - 0 ratings