title: How I load a script from assets to Angular2 project?
body: <p>I would like to import a script from <code>assets</code>. I do this at <code>index.html</code>
  </p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;...&lt;/title&gt;
    &lt;base href="/"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;!--npm package : image-compressor--&gt;
    &lt;script src="/assets/image-compressor/image-compressor.js"&gt;&lt;/script&gt;
    &lt;script src="/assets/material-components-web/dist/material-components-web.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;app-root&gt;
      Loading...
    &lt;/app-root&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>and in <code>app.component.ts</code>
  </p>
  
  <pre><code>import { Component } from '@angular/core';
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent {
    title = '...';
    ngOnInit(){
      var imageCompressor = new ImageCompressor(); //create a ImageCompressor from image-compreeor package
      console.log(imageCompressor)
      ...
    }
  }
  </code></pre>
  
  <p>then I got a error which has been throw at running, although the error, the website still run and show the ImageCompressor which got on <code>app.component.ts</code>.
  when I build project <code>ng build</code> will be got same error</p>
  
  <pre><code>ERROR in src/app/app.component.ts(??,31): error TS2552: Cannot find name 'ImageCompressor'. Did you mean 'imageCompressor'?
  </code></pre>
  
  <p>How could I do?</p>
  
  <p>Thanks!</p>