Installing Angular PWA
Angular comes with great support for service workers, and in recent versions, it has become super easy to set up. Whereas previously you had to manually install the dependencies, edit the Angular config, import a module, and configure it, you can now simply use the ng add
command that got introduced in Angular CLI v6.
Exercise 46: Adding Angular PWA
In this exercise, we will add Angular PWA to our app. Follow these steps to complete this exercise:
- Open the terminal in the project directory.
- Install the necessary dependencies using the
npm
command:ng add @angular/pwa --project angular-social
- When the installation is successful, we should see the new package added to the
dependencies
object in our project'spackage.json
file.
Let's move on to the next section, where we will enable the service worker in the application.