I have an object like this:
function Point(x,y)
{
this.coorX = x;
this.coorY = y;
}
function Node(id,x,y)
{
this.id = id;
this.point = new Point(x,y);
this.getDescription = function(){
return this.id + ': (' + this.punto.coorX + ', ' + this.punto.coorY + ')';
}
}
I export a list of node in json format with:
JSON.stringify(NodeList);
json:
{"NodeList":[{"id":0,"point":{"coorX":15,"coorY":15},"$$hashKey":"004"},{"id":1,"point":{"coorX":15,"coorY":151},"$$hashKey":"009"},{"id":2,"point":{"coorX":25,"coorY":15},"$$hashKey":"00E"}]}
After if I import the same json with:
NodeList = JSON.parse(text);
After the import how can I use the Node function getDescription()?