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)

Testing the Service Worker

In this section, we will see how we can test our service worker.

Checking Where the Data Comes From

Using the Chrome Developer Tools, it's easy to see where a particular resource is being retrieved from.

Using the Network tab in Chrome Developer Tools, you can see what files are being retrieved, where the data comes from, and how long it took the browser to fetch those resources. This following screenshot shows a normal page request, where each of the files are downloaded from the web server:

Figure 3.1: A normal page request
Figure 3.1: A normal page request

In the following screenshot, you can see in the Size column that the data is retrieved from the service worker. This means that it did not make a request to the network to fetch those items; instead, it got it from the browser cache:

Figure 3.2: A page request with service worker enabled
Figure 3.2: A page request with service worker enabled

Enabling Offline Mode

It's in the nature of a web browser to be online...