Lazy Loading is more popular everyday. With external libraries we can use it even in older frameworks, like AngularJS. We need ocLazyLoad — it works well with UI Router library.Lazy loading really can improve user experience. Photo credits: Pixabay.PrerequisitesBefore we dive into code with Lazy Loading usage, let's look on some base ideas behind it and core libraries we need to implement it.Lazy LoadingLazy loading is a technique which allows us to deferre loading unneeded resources. For scripts, one of the most popular technique is dividing files by route. For example, route for login page loads only scripts needed for login, articles route loads only scripts needed for articles etc. Lazy Loading scripts makes application application much more faster from user perspective — javascript needs to be loaded, parsed and compiled. As a user, I would rather wait for every page load few hundred miliseconds that wait over a dozen seconds to see login page — and that is how it looks on slower mobile devices.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to


lazy-loading,front-end-development,angularjs,angular-ui-router,javascript