I know this is probably painfully basic, but i am having a tough time wrapping my head around it.
class Main
{
constructor()
{
requestAni
How about doing it this way? Declare a global variable of type "myClass" and initialise it in the constructor of the class:
var _self: myClass;
class myClass {
classScopeVar: string = "hello";
constructor() {
_self = this;
}
alerter() {
setTimeout(function () {
alert(_self.classScopeVar)
}, 500);
}
}
var classInstance = new myClass();
classInstance.alerter();
Note: It is important NOT to use "self" as it as a special meaning already.