I am having an anguler.js array like below,
"serviceLevels": [
{
"cutOffTime": "11:00",
"dgs": [
{
"active": "Y",
"cutoffTime": null,
"dgId": "DG100",
"locations": [
{
"active": "Y",
"effEndDt": "2015-05-15T19:37:00+0000",
"effStDt": "2015-05-15T19:37:00+0000",
"locId": "BBY_1000",
"rank": 1
}
],
"rank": "1"
},
{
"active": "Y",
"cutoffTime": null,
"dgId": "DG8113",
"locations": [
{
"active": "Y",
"effEndDt": "2015-08-11T09:46:00+0000",
"effStDt": "2015-08-11T09:46:00+0000",
"locId": "BBY_1064",
"rank": 1
}
],
"rank": "1"
}
],
"overrideCutOffTime": "",
"serviceLevel": "SAME_DAY"
}
]
From the above array I need to remove cutoffTime attribute from dgs array.I'm trying like this but its taking null value, can anyone help me on this?.
var svcs = eval($scope.rgnSvcLevels);
for (var j = 0; j < svcs.length; j++) {
var dgs = eval(svcs[j].dgs)
if (dgs != null) {
for (var k = 0; k < dgs.length; k++) {
dgs[k].cutoffTime=null
}
}
}