Installing Dependencies

Angular comes with support for service workers. In order to use it, we first need to install the dependencies.

  1. Open the terminal in the project directory.
  2. Install the dependencies needed using the npm command:
    npm install @angular/service-worker
  3. When the installation is successful, we should see the new package added to the dependencies object in our project's package.json file:
    Installing Dependencies

In this section, we have installed the dependencies for our service worker, which is the first step in implementing service workers in our app. Let's move on to the next section, where we will enable the service worker in our application.

Get Beginning Server-Side Application Development with Angular now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.