title: Angular4 Print Handler
body: <p>I am using Angular 4. HostListener does not seem to support window.onbeforeprint event handler. For chrome I was able to add a listener for window.matchMedia('print') outside of HostListener. However this does not work for IE and Firefox. What is the best way to work with window.onbeforeprint in angular 4.</p>
  
  <pre><code>@HostListener('window:onbeforeprint',['$event'])
  onBeforePrint(event){
  console.log('Before print');
  }
  </code></pre>
  
  <p><a href="https://plnkr.co/edit/4ZdLNklitwsucH0X6Azv" rel="nofollow noreferrer">https://plnkr.co/edit/4ZdLNklitwsucH0X6Azv</a></p>