Home > OS >  How to load (fully or partially) new page before making the transition
How to load (fully or partially) new page before making the transition

Time:09-23

I would like to make the transition between my pages as seamless as possible. Is there a way for things to happen in this order:

  1. Click on button to change page
  2. Load page to which I'm moving fully (or partially) (no page transition yet)
  3. Do page transition

I'd rather have it this way than click, redirect, and then wait on the page that everything loads.

This loading process would also include calling methods from the new page to do things like make calls to the database etc.

CodePudding user response:

Sounds like a text-book use case for Angular resolvers: You might want to take a look at this.

To summarize the concept: when attempting to navigate to a particular route and there's a resolver configured, everything would be resolved (eg. load some data from backend, prepare it etc) before navigating to the route.

  • Related