Angular 2 training in Mumbai: – Lazy loading.

Lot of students where asking for a working code of Angular 2 lazy loading. So below is the video for the same.

The magic of lazy loading in angular 2 happens in routing. In routing you need to use “loadChildren” with the path to the module in a string.

export const ApplicationRoutes = [
    { path: 'Welcome', component: WelcomeComponent },
    { path: 'UI/Master.html', component: WelcomeComponent },
    { path: 'Customer', loadChildren: 'Binder/CustomerModule#CustomerModule'},
    { path: 'SupplierMain', loadChildren: 'Binder/SupplierModule#SupplierModule'}

Below is a simple video which demonstrates how lazy loading looks like.

Do not miss our Angular 2 training happening this coming Saturday and Sunday in Mumbai



This entry was posted in Angular 2 training, Angular Mumbai Training, Class Room Training and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *