title: Angular 2+ window.onfocus and windows.onblur
body: <p>So I need in Angular 2 or 4 to manage when the browser tab of my app is focused or not. Is there any way to use the <code>window.onfocus</code> and <code>window.onblur</code> ? </p>
  
  <p>Thanks a lot </p>