2
Reply

How to add items in json data object while sending to DB

Karthik Kumar

Karthik Kumar

Dec 6 2017 4:56 AM
190
 i need to upload abulk data of jsonobject.In service .ts i need to add extraa 4 more values to that object.In body ineed to get this values to save how can i append these 4 values to body
 
 my service.ts
************** 
SaveData(uploaddata: any) {
 
//this four data i need to add to the object "body"
// ID":ID,
// "CreatedBy": "",
// "CreatedOn": "",
// "UpdatedBy": "",
// "UpdatedOn": ""
/
let body = JSON.stringify(uploaddata)
console.log(body)
let headers = new Headers({
'Content-Type':
'application/json; charset=utf-8'
});
let options = new RequestOptions({ headers: headers });
return this._http.post(this.Savecsv, body, options)
.map(res => <data>res.json())
.catch(this.handleError);
}

Upload Source Code  Select only zip and rar file.
Answers (2)