robwormald / ng-universal-demo

256 stars 125 forks source link

Q: What does BrowserModule.withServerTransition exactly do?? #10

Closed harshes53 closed 7 years ago

harshes53 commented 7 years ago

@justindujardin

Also, how can I pass appId inside withServerTransition api ??

Thanks for putting a demo app!

harshes53 commented 7 years ago

Basically, what withServerTransition API does is removes all the CSS from the page once the client/browser finishes bootstrapping the app. If you notice you will find the style elements with ng-transition="<appId>" in the server-side rendered html.

simeyla commented 3 years ago

Here's a couple relevant source files:

https://github.com/angular/angular/blob/master/packages/platform-browser/src/browser/server-transition.ts https://github.com/angular/angular/blob/master/packages/platform-browser/src/browser.ts

It looks like you could register other 'transitions' if you really needed. The only thing I could think of is maybe some kind of timing instrumentation, but you could just as well do that somewhere else.