i have this javascript prototype:
Utils.MyClass1 = function(id, member) {
this.id = id;
this.member = member;
}
and i create a new Object:
var myobject = new MyClass1("5678999", "text");
if i do:
console.log(JSON.stringify(myobject));
The result is:
{"id":"5678999", "member":"text"}
but i need that the typeof the objects includes in json string, like this:
"MyClass1": { "id":"5678999", "member":"text"}
There are a fast way using any framework or something? or i need to implement the toJson() method in the class and do it manually.
Thanks!