Lazy Loading

What Does Lazy Loading Do in Ionic?


Lazy loading has been around for a while now, and it’s likely that you’ve had at least some experience with it if you have been building Ionic applications recently (the Ionic CLI page generator uses lazy loading by default). If you aren’t familiar with lazy loading, then you might be interested in checking out this video.

To enable lazy loading on a page we need to add the @IonicPage decorator and create a module for that page. A lot of people probably understand that lazy loading has something to do with making the application perform better, but it’s not so obvious what it actually does.

In this video tutorial, I walk through the difference between using lazy loading and not using lazy loading. I have two identical example applications (one with lazy loading), and we use a debugger to inspect what is going on behind the scenes.

Here’s the video:

What to watch next...

  • Josh, great article … thanks for the quality content!

    I’m starting my studies on the Ionic / Angular … so I still have some doubts.

    From what I understand, when build for a native platform like Android all the application files are packaged.

    That way, how exactly does lazy load affect an android app considering there will be no file transfer via network?

    Does Lazy load improve memory consumption?