0
私は欲しいものを手に入れたいと思っていますが、それはかなりありません。 私はこれがあります。これを生成している私のモジュールの等書体は何ですか?
export class RichTextArea {
text: string;
constructor(params: any)
{
this.text = params.text;
}
}
(AMD):
define(["require", "exports"], function (require, exports) {
"use strict";
var RichTextArea = (function() {
function RichTextArea(params) {
self.text= params.text;
}
return RichTextArea;
}());
exports.RichTextArea = RichTextArea;
});
私はそれがこのようなものを生成する必要がある(輸出への変更を参照してください):
define(["require", "exports"], function (require, exports) {
"use strict";
var RichTextArea = (function() {
function RichTextArea(params) {
self.text = params.text;
}
return RichTextArea;
}());
return RichTextArea; //I need this so that it is immediately available
});
を
これを達成するために私のTSで何を変更しなければなりませんか?
class RichTextArea {
text: string;
constructor(params: any)
{
this.text = params.text;
}
}
export = RichTextArea;
出力この:私は私のモジュールをインポートすると 、私はmymodule.RichTextArea(のparamsを)言っているにしたくない、私はのmymodule(のparams)
私はsooo closeで、私は 'export RichTextArea'を試しました、私はそれを割り当てませんでした!これは完全に機能します。ありがとう、これで苦労した。 – 4imble