Skip to main content
Angular PWA

PWA Overview

Estimated Time: 2 hours | Difficulty: Intermediate | Prerequisites: HTTP, Caching
Progressive Web Apps (PWAs) combine the best of web and native apps. They are reliable (work offline), fast (cached resources), and engaging (installable, push notifications). Think of a PWA as giving your web app a “native disguise” — users can install it to their home screen, it launches without the browser chrome, and it works even when the network drops. The honest trade-off: PWAs are not a replacement for native apps in every scenario. You lose access to some device APIs (Bluetooth LE on iOS, background processing), the install experience is less discoverable than app stores, and iOS Safari still lags behind Chrome in PWA support. But for content-heavy apps, internal tools, and e-commerce — where you want reach over richness — PWAs are an excellent fit.

Setup Angular PWA

Service Worker Configuration

The ngsw-config.json is the brain of Angular’s service worker. It defines two critical things: asset groups (your app shell — HTML, JS, CSS, images) and data groups (API responses). The caching strategies here determine the offline experience your users get, so it is worth understanding each option.

Web App Manifest


Service Worker Updates


Offline Support

Offline Detection

Detecting offline status sounds simple, but there is a nuance: navigator.onLine only tells you if there is a network connection, not if the internet is reachable. A user connected to airport Wi-Fi with a captive portal shows as “online” but cannot reach your API. For critical operations, combine the browser’s online/offline events with actual health-check pings to your server.

Offline Data with IndexedDB


Push Notifications


Install Prompt


Background Sync


Testing PWA

PWA Audit with Lighthouse


Next: Deployment & CI/CD

Deploy your Angular application with modern CI/CD practices