Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Loading indicator when Lazy Loadding Ionic component (ion-item, ion-fab, etc) - PWA

$
0
0

Ok, Firstable i am talking about a web site using ionic, like a PWA, running in a public network, hoting in a web server, not about a native app, where everything is local storaged.

I know how to show a loading indicator when Lazy load ROUTES, something like this:

this.router.events.subscribe(event => {
if (event instanceof RouteConfigLoadStart) {
this.loading.show();
} else if (event instanceof RouteConfigLoadEnd) {
this.loading.hide();
}
});

But Ionic also lazy load its componnets, so for example if i navigate from a blank page to a page with a list of items, the will be lazy load at that momment. That is great to init load performance, but on slow mobile networks it causes a long (about 2-3 seconds) in the page load when navigate, so it looks like the page was doing nothing.

I want to show some kind if indicator, so the user know that the site is working. Is there any event or any way to know when a component start/end loading (just like the routes).

even better, i there any way to preload all the used componnets?

Thanks!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>