When a class is defined like the following in a file named MyClass.ts:
export default class {
static someProperty = 1;
someMethod() {
var a = ????.someProperty
}
}
How can we access someProperty? The code this.someProperty
will not work, and neither can we use a name. If it were a named class, we could access it through SomeClassName.someProperty
.
After loading the module in another file, we can access it using:
MyClass.someProperty