When an Angular Universal application bootstraps in the browser, it replaces the whole server-side-rendered page with content generated in the client. Although in many cases it is possible to make this transition seem seamless by employing certain techniques, it is still not hydration.
Here's an example issue that arises from this. Say there's a server-side-rendered input field and I manage to type something into this input before the client app bootstraps. If that happens, I will lose whatever I entered as soon as the client application bootstraps.
While I am not too concerned with this happening to my users, it does cause issues with E2E tests. The driver starts typing as soon as there are input nodes available and then the data entered is lost once the client app is bootstrapped. I would like to force the test driver to wait until the client app is bootstrapped.
My question: how can I detect the moment when Angular has switched it's server-side-rendered content for the client-generated application?
It seems that whenever bootstrapModule()
resolves, this has already happened. Am I correct and is this reliable?