title: window.onstorage is not working with Angular
body: <p>I'm trying to create window event listener that must listen for the event in the other tab, where opened another instance of the same application.<br/>
  <strong>Some service:</strong></p>
  
  <pre><code>public validateItemAgainstServer = (item: EspApplication) =&gt; {
      ...
           window.localStorage.setItem('item', "|")
        ...
      });
    }
  </code></pre>
  
  <p><strong>Component</strong></p>
  
  <pre><code>constructor(private winRef: WindowRef) {
      winRef.nativeWindow.addEventListener('storage', function (e) {
        console.log("storage event occured");
     }, false);
      window.addEventListener('storage', function (e) {
        console.log("storage event occured");
     }, false);
    }
  </code></pre>
  
  <p><strong>WinRef</strong></p>
  
  <pre><code>import { Injectable } from '@angular/core';
  
  function _window(): any {
     // return the global native browser window object
     return window;
  }
  
  @Injectable()
  export class WindowRef {
     get nativeWindow(): any {
        return _window();
     }
  }
  </code></pre>
  
  <p>Regretfully, onstorage event was not fired. Is it possible to fix this solution or may be there is some better ideas of how to synchronize two tabs in Angular?</p>