ng-universal-demo icon indicating copy to clipboard operation
ng-universal-demo copied to clipboard

onBootstrap

Open paulogr opened this issue 7 years ago • 1 comments

export function onBootstrap(appRef: ApplicationRef, transferState: TransferState) {
  return () => {
    appRef.isStable
      .filter(stable => stable)
      .first()
      .subscribe(() => {
        transferState.inject();
      });
  };
}

Is this garanteed?

I have a medium-size angular application and I'm trying to apply the state transfer but my state is being injected before the backend calls...

Anyone had this problem? What can I doing wrong? Thank you!

paulogr avatar Jun 07 '17 18:06 paulogr