有没有结合TypeScript和dojo AMD使用AMD的例子?继续获取"3“,而不是对象(tslab == 3):
require( ["TypeScriptLab"], function ( tslab )
{
new tslab.Tests().run();
} );TypeScript如下所示:
export class TypeScriptLab {
test() {
}
}生成的JS如下所示:
define(["require", "exports"], function(require, exports) {
var TypeScriptLab = (function () {
function TypeScriptLab() { }
TypeScriptLab.prototype.test = function () {
};
return TypeScriptLab;
})();
exports.TypeScriptLab = TypeScriptLab;
})发布于 2012-10-20 06:16:33
我定义了我的包:
<script>
dojoConfig = {
async: true,
packages: [
{ name: "TSLab", location: "/IPS" }
]
};
</script>并添加了名称空间前缀:
require( ["TSLab/typeScriptLab"], function ( tslab )
{
new tslab.Tests().run();
} );模块现在就加载了。
https://stackoverflow.com/questions/12982329
复制相似问题