title: How to import JavaScript file into angular2
body: <p>I am having trouble figuring out how to import a javascript file into my angular2 project. It is a file that is not a module that is apart of npm and the only instructions I have been able to find is using npm which is not an option here.</p>
  
  <p>I am using angular cli and in my angular-cli.json file I have:</p>
  
  <pre><code>{
  "apps": [
    "styles": [..],
    "scripts": ["../pathtomyjs/file.js"] 
  ]}
  </code></pre>
  
  <p>I ran ng build and ng serve and when I open up my app and look at the web console and try referencing the function that is in my js file, I am able to do so successfully.</p>
  
  <p>Example in the console I type in:</p>
  
  <pre><code>var test = MyObject; 
  </code></pre>
  
  <p>and I get test = {};</p>
  
  <p>However, when I try do </p>
  
  <pre><code>let test = MyObject;
  </code></pre>
  
  <p>in my component .ts file I get :</p>
  
  <pre><code>home.component.ts (10,11): Cannot find name 'MyObject'.)
  </code></pre>
  
  <p>Not sure how to do this in Angular2.</p>
  
  <p>Thanks!</p>