Reputation: 4494
Referencing the full qualified name of the static function works.
class Shape {
spin {
Shape.log("something");
}
static log(text: string) {
}
}
Is there a short way to reference the static "log" function ? Without the full class name ?
Upvotes: 1
Views: 147
Reputation: 164397
You can create a function that calls Shape.log
:
class Shape {
spin() {
log("something");
}
static log(text: string) {}
}
function log(message: string) {
Shape.log(message)
}
Upvotes: 1
Reputation: 10685
No, there is currently no shorthand to access the static function in the local object.
As in your example, you must use the fully-qualified name.
Upvotes: 0