Tuesday, November 27, 2018

There is a prefetch feature for Angular routing. You may use it to spin a spinner and not show the thing you are to load until it is prepped and ready.

This and this suggests that one may use the NavigationStart, NavigationEnd, and NavigationCancel events described here and here along with also an NavigationError event to display a spinner or hourglass or the like until the preprep at a destination is done and then drop the effect. It might be the ngAfterViewInit event firing at a component timed with the NavigationEnd event at the routing. I'm not certain yet. I also am unsure of how to delay this event while awaiting a promise that will bring back data from an API endpoint to hydrate the view with stuff.

No comments:

Post a Comment