I'm working on the report page which have to process a big JSON Object. This JSON object may contain at least 500 to 600 inner JSON objects. I have to iterate them all and have to display them in my report page.
During JSON iteration, I am getting in the browser:
RangeError: Maximum call stack size exceeded
Any idea's how to handle this big JSON object in client side? Any do's and don'ts for me?
Currently I'm splitting my big JSON object into smaller JSON objects not sure whether this approach yield desired result
Updated:
In the recursive nested
method below, I'm getting the error. Before sending any values I have reduced the size of the JSON. value1
is my reduced JSON Object(any how it will have at least 100 JSON objects).
function nested(value1) {
var final1 = {};
var Keys1 = Object.keys(value1);
if (angular.equals(Keys1, $scope.Headers)) {
return final1;
} else {
angular.forEach(value1, function(value, key) {
final1[key] = {}; // Getting the error in this line
final1[key] = nested(value);
});
}
return final1;
}
Edited: I have taken skeleton of the JSON object. In below JSON object each levels can have 50 JSON Objects and levels can be extended upto 10.
"First": {
"second-1": {
"level3": {
"data1": {
"Key1": "val1",
},
"data2": {
"Key2": "",
},
"dat3": {
"Key3": "",
}
},
"second-2": {
"Level3": {
"Level4": {
"data1": {
"Key1": ""
},
"data2": {
"Key1": ""
}
},
}
}
}
}