Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onBootstrap #17

Open
paulogr opened this issue Jun 7, 2017 · 1 comment
Open

onBootstrap #17

paulogr opened this issue Jun 7, 2017 · 1 comment

Comments

@paulogr
Copy link

paulogr commented Jun 7, 2017

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!

@FrozenPandaz
Copy link
Owner

Not sure, if the data from your backend calls is in the transfer state it should be there by this point. This should be approximately right before the render happens. Note: the TransferState does not automatically pick up your backend data, you must use TransferHttp in place of Http

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants