What is the most efficient way to set values for a JSON object coming from the backend? I am familiar with manually setting values based on the key param, but are there any other optimized approaches I should consider?
//backend response
"response": {
"senderCode": "123",
"senderName": "test2",
"receiverCode": "456",
"name": "test",
"contactnumber": "1233333333"
}
//formgroup structure
this.Form = this.fb.group({
receiverCompanyCode: null,
// Sender Information
senderInformation: this.fb.group({
senderCompanyCode: [null],
senderName: [null],
}),
// Contact Information
contactInformation: this.fb.group({
name: [null, Validators.required],
telephone: [null, Validators.required],
}),
});