PWA in action
As we mentioned in step 4, the Angular engine applies the service work in the application only in production mode; that is, only when we use the ng build
command.
So, let's look at how this works in practice. But first, let's see if everything has happened as expected, with the creation of the application and the installation of @angular/pwa
:
Open your Terminal window in the
./Client
folder, and type the following command:
npm start
Remember that the npm start
command is the same as ng server
; you can check all of the npm
aliases on the scripts
tag inside of package.json
. There, we have the following aliases:
"scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }
At the end of the previous command, we can see the following message as the output:
** Angular Live Development Server is listening on localhost:...