title: Typescript instanceof - Cannot find name
body: <p>I have a problem with Typescript compilation. This code returns the error:</p>
  
  <blockquote>
    <p>error TS2304: Cannot find name 'NavigationEnd'.</p>
  </blockquote>
  
  <p>How can I make the compiler know about NavigationEnd type? NavigationEnd is angular2 router event type.</p>
  
  <pre><code>this.router.events.subscribe((e) =&gt; {e instanceof NavigationEnd ? 
  console.log('NavigationEnd'):console.log('Not NavigationEnd')});
  </code></pre>
  
  <p>I`m using IDE PHPStorm.</p>