I am getting the following error when I build the following typescript code.
Property 'runStaticMethod' is a static member of type 'DemoClass'
Typescript Code:
export class Main {
constructor(private demo: DemoClass) { }
public run() {
this.demo.runStaticMethod();
}
}
export class DemoClass {
public static runStaticMethod() {
console.log('run...');
}
}
new Main(DemoClass).run();
I am getting the following console
error when I build the above typescript
code. But the javascript
code is running as expected.
Console Error:
Chitty:tsc NatarajanG$ tsc
src/index.ts:5:19 - error TS2576: Property 'runStaticMethod' is a static member of type 'DemoClass'
5 this.demo.runStaticMethod();
~~~~~~~~~~~~~~~
Chitty:tsc NatarajanG$