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