title: Angular 2 : external js file variables are accessible from component
body: <p>I am trying to import an external js file to my component.</p>
  
  <p>external.js</p>
  
  <pre><code>var x=9;
  </code></pre>
  
  <p>component.ts</p>
  
  <pre><code>import '../../assets/api/external.js';
  declare let x: any;
  ....
  console.log(x);
  </code></pre>
  
  <p>and I get :</p>
  
  <pre><code>ERROR ReferenceError: x is not defined
  </code></pre>
  
  <p>How can I access x from the component? It does not complain about not being able to find the js file.</p>