how to make angular 4/6 faster in loading?

别说谁变了你拦得住时间么 提交于 2019-12-13 11:20:06

问题


In Angular 6, I have created lazy module and it takes a-lot time to load while routing.

Is there any way to create faster web application in angular 6 ?


回答1:


If loading a module while navigating takes too much time, you could consider eagerly preloading modules instead. What this does is load your main application module first and display your view, and in the background load all the other modules even before you navigate to them.

You can use the following RouterModule configuration to make that work:

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

You can refer to the official documentation for more information.



来源:https://stackoverflow.com/questions/50434416/how-to-make-angular-4-6-faster-in-loading

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!