1

I am wondering how I can make router wait with initialisation of a view, until I get the values from backend. My case is: I have a ecommerce shop, which gets the list of products based on the city you've picked in the first step. When user refreshes webpage on any other step, he should be presented with list of products, that are not yet fetched from the server. How can I make the router/component wait until products are indeed loaded, to load the view?

uksz
  • 18,239
  • 30
  • 94
  • 161

1 Answers1

2

You can use guards or resolver to delay routing See also

or APP_INITIALIZER to delay bootstrapping until the configuration is available.
See also

Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567