title: Angular PWA - Route to custom offline page when no connection available
body: <p>In an Angular PWA I would like to redirect the user to a custom offline page (offline.html) if there is no internet connection available.</p>
  
  <p>Using the <code>ng-sw.config.json</code> file I setup the assets and APIs to be cached and which strategy to use (performance/freshness) and I could serve the application even when offline without any problems.
  Now I would like to show a custom offline page, but among tutorials and guides I could not see a way to achieve this with Angular and its service-worker module.</p>
  
  <p>I am wondering whether a possible solution would be to create a service that checks the connectivity (online/offline) and, if offline, it redirects to offline.html page. Service and html page would be cached with a 'prefetch' strategy to ensure they are available as soon as the service worker is installed.</p>
  
  <p>Otherwise I would create a base service worker that imports the default Angular service worker and adds logic to redirect to the offline page if the fetch call fails.</p>
  
  <p>Are there any other possibilities?</p>