title: How to Listen for Service Worker (sw-precache) Updates from Inside Angular 4
body: <p>In the <a href="https://github.com/GoogleChrome/sw-precache/blob/7688ee8ccdaddd9171af352384d04d16d712f9d3/demo/app/js/service-worker-registration.js#L49-L51" rel="nofollow noreferrer">SW-Precache demo code</a>, there's a line that logs to the console when "the old content will have been purged and the fresh content will have been added to the cache." It also says in the comments that this is a good time to let the user know that new content is available. </p>
  
  <p>That script, however, is located within the service worker registration block, which I have located in my <code>index.html</code> file (or my <code>main.ts</code> file; I've tried both ways). However, I want to be notified of this update <em>from within an angular component</em>, so I can display a nice notification to the user. </p>
  
  <p>What's the proper way to do this? I creating an observable in <code>main.ts</code> and importing that in my component, but that leads to circular reference errors.</p>