I created a model class to represent an object. The deserialize function is meant to populate it from a JSON string.
export class MyData
{
public name:string;
public job:string;
public deserialize (input:any) : MyData
{
Object.assign (this, input);
return this;
}
}
var md:MyData = new MyData ().deserialize ({ name: "max", job: "sales" }));
console.log ("md="+md);
However, the variable 'md' is still showing as an Object.
md=[object Object]
What could be the issue here? Appreciate any help, thank you!