class Test {
otherFunction() {}
method() {
this.otherFunction();
}
}
Above typescript will generate ES5 js like this
var Test = /** @class */ (function () {
function Test() {
}
Test.prototype.otherFunction = function () { };
Test.prototype.method = function () {
this.otherFunction();
};
return Test;
}());
How to get output like below function after compiling typescript?
var Test = (function() {
function Test() {}
function otherFunction() {}
Test.prototype.method = function () {
otherFunction();
}
return Test;
})();
Compile this one
(function () {
function Test() {}
function otherFunction() {}
Test.prototype.method = function () {
this.otherFunction();
};
return Test;
})();
It will generate
(function () {
function Test() { }
function otherFunction() { }
Test.prototype.method = function () {
this.otherFunction();
};
return Test;
})();