Here's an example for you:
export class MyClass {
myString: string;
constructor(s: string) {
this.myString = s;
}
myFunction() {
return "hello " + this.myString;
}
}
export class MainComponent {
static object1: MyClass = JSON.parse(`{"myString":"1234"}`);
MainComponent.object1.myFunction(); // Error: myFunction is not a function
}
The issue arises because the function member is not recognized in the static object. I'm receiving an error: myFunction is not a function