title: How to import external modules inside of a loop in TypeScript?
body: <p>I am trying to import "ui" inside of the loop (for dynamic loading based off of <code>_moduleList</code>. This works fine:</p>
  
  <pre><code>var _moduleList: Array&lt;string&gt;;
  _moduleList.push("mdlGame");
  import _tmp = require("ui");
  for (var _i: number = 0; _i &lt; _moduleList.length; ++_i) {
  
  }
  </code></pre>
  
  <p>Whereas this displays a red squiggly line underneath <code>import</code>, saying "Unexpected token; 'statement' expected.":</p>
  
  <pre><code>var _moduleList: Array&lt;string&gt;;
  _moduleList.push("mdlGame");
  for (var _i: number = 0; _i &lt; _moduleList.length; ++_i) {
      import _tmp = require("ui");
  }
  </code></pre>
  
  <p>Does <code>import</code> not count as a statement? What is going on here, and is there a way I can work around it?</p>