【发布时间】:2017-07-26 03:05:57
【问题描述】:
我正在使用带有数据表的 angular 2 来修改大型数据集。修改后,我需要使用弹簧将更改保存在我的数据库中。
这是我发送到服务器的 json。
{
"id":3,
"mois":"2017-07-01",
"status":"Soumise",
"ligneNoteDeFrais":{
"2017-07-10":{
"id":1,
"day":"2017-07-10",
"fk":{
"id":2,
"description":"frais kilomtrique",
"nb":5,
"pu":6,
"totale":44,
"typeNoteDeFrais":null
},
"preuves":[],
"detailFrais":{
"12":{
"id":1,
"description":"test",
"nb":5,
"pu":4,
"totale":0,
"typeNoteDeFrais":{
"id":12,
"intitule":"gg",
"justifiable":true,
"justificationObligatoire":true,
"quantifiable":true,
"new":false
}
},
"14":{ },
"15":{ },
"18":{ },
"19":{ }
}
},
"2017-07-01":{
"fk":{ },
"detailFrais":{
"12":{ },
"14":{ },
"15":{ },
"18":{ },
"19":{ }
}
},
"2017-07-02":{
"fk":{ },
"detailFrais":{
"12":{ },
"14":{ },
"15":{ },
"18":{ },
"19":{ }
}
}
}
}
如您所见,此 JSON 中有一些空条目
是否有解决方案可以在将这些条目发送到服务器之前删除它们,或者使它们不映射到对象中。
【问题讨论】:
-
这个问题与角度无关。这是一个 js/ts 问题。
标签: javascript typescript