Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Server-Side Enterprise Development with Angular

You're reading from   Server-Side Enterprise Development with Angular Use Angular Universal to pre-render your web pages, improving SEO and application UX

Arrow left icon
Product type Paperback
Published in Nov 2018
Publisher
ISBN-13 9781789806267
Length 142 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Bram Borggreve Bram Borggreve
Author Profile Icon Bram Borggreve
Bram Borggreve
Arrow right icon
View More author details
Toc

Enabling Support for Lazy Loading

To get our server-side rendering working correctly, we need to make sure that we add the ModuleMapLoaderModule. This is a third-party module that is needed to make Angular Universal apps work with lazy loading.

In software development, we talk about lazy loading if we defer loading a certain object or piece of code to the point where we need it. In Angular specifically, this is done by defining certain routes to be loaded at the moment they are requested. The Angular build process will use code splitting to build lazy-loaded parts of the application in separate files. When the user then navigates to this part of the application, the browser will download that file and execute it.

The benefit of this approach is that the initial download size is smaller, and that a user does not have to download parts of the application that are not being used. This decreases the initial loading time of the application and potentially saves network bandwidth.

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime