The initial fetch can happen on the server too! SSR to the rescue!
But it's not needed for normal SPA.
For websites it's crucial!
The initial fetch can happen on the server too! SSR to the rescue!
But it's not needed for normal SPA.
For websites it's crucial!
So, the best thing you can do is to start fetching as soon as possible! And for that you can use the router!
Don't fetch inside ngOnInit. Fetch inside a route resolver! That's why it's there!
Move data fetching up, as much as possible!
So, the best thing you can do is to start fetching as soon as possible! And for that you can use the router!
Don't fetch inside ngOnInit. Fetch inside a route resolver! That's why it's there!
Move data fetching up, as much as possible!