title: How to load external scripts dynamically in Angular?
body: <p>I have this module which componentize the external library together with additional logic without adding the <code>&lt;script&gt;</code> tag directly into the index.html:</p>
  
  <pre><code>import 'http://external.com/path/file.js'
  //import '../js/file.js'
  
  @Component({
      selector: 'my-app',
      template: `
          &lt;script src="http://iknow.com/this/does/not/work/either/file.js"&gt;&lt;/script&gt;
          &lt;div&gt;Template&lt;/div&gt;`
  })
  export class MyAppComponent {...}
  </code></pre>
  
  <p>I notice the <code>import</code> by ES6 spec is static and resolved during TypeScript transpiling rather than at runtime.</p>
  
  <p>Anyway to make it configurable so the file.js will be loading either from CDN or local folder?
  How to tell Angular 2 to load a script dynamically?</p>