Sunday, September 10, 2017

Use a second property at .forRoot to loop in the ability for progressively preloading, behind the scenes, that which will be lazy loaded.

RouterModule.forRoot(whatever, { preloadingStrategy: PreloadAllModules })

 
 

You loop this in an Angular 4 app from '@angular/router' as shown here using a second parameter for .forRoot (the first being an array of routes) which is configuration settings as suggested above and hopefully this will, in tandem with the lazy loading, will help you keep your head above water.

No comments:

Post a Comment