Book Image

Server-Side Enterprise Development with Angular

By : Bram Borggreve
Book Image

Server-Side Enterprise Development with Angular

By: Bram Borggreve

Overview of this book

With the help of Server-Side Enterprise Development with Angular, equip yourself with the skills required to create modern, progressive web applications that load quickly and efficiently. This fast-paced book is a great way to learn how to build an effective UX by using the new features of Angular 7 beta, without wasting efforts in searching for referrals. To start off, you'll install Angular CLI and set up a working environment, followed by learning to distinguish between the container and presentational components. You'll explore advanced concepts such as making requests to a REST API from an Angular application, creating a web server using Node.js and Express, and adding dynamic metadata. You'll also understand how to implement and configure a service worker using Angular PWA and deploy the server-side rendered app to the cloud. By the end of this book, you'll have developed skills to serve your users views that load instantly, while reaping all the SEO benefits of improved page indexing.
Table of Contents (5 chapters)

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.

...