After receiving the response from the backend, I have retrieved a nested hash map structure where one hash map is nested within another:
hmap.put(l,hmaps); //hmap within hmap
When returning the response to the frontend, I am using the ResponseEntity method to send back the data in the following format:
The structure of the response obtained from the Backend is as follows:
In this structure, 'email1' and 'email2' act as keys for a main hash map, with their corresponding subparts being key-value pairs within the nested hash map.
responsive: {email2: {,…},…}
email1: {sub3: "Hi Subpart 3", sub4: "Hi Subpart 4",…}
sub1: "Hi subpart 1"
sub2: "Hi subpart 2"
sub3: "Hi Subpart 3"
sub4: "Hi subpart 4"
email2: {,…}
sub7: "Hi Subpart 7"
sub8: "Hi Subpart 8"
To access 'email1' and 'email2' in my code, I have utilized the following approach:
Object.keys(emails.responsive).forEach(e => {
let ref = this.dialog.open(emaildialog, {
data: emails.responsive[e],
width: "600px",
height: "600px",
}
);
});
However, I am currently facing difficulties in accessing the individual subparts of each Email type.