When retrieving data from an API, the structure looks like this:
"key1" : {
"subkey1" : value
"subkey2" : value
"subkey3" : value
}
"key2" : {
"subkey1" : value
"subkey2" : value
"subkey3" : value
"subkey4" : value
"subkey5" : value
}
"key3" : {
"subkey1" : value
"subkey2" : value
"subkey3" : value
"subkey4" : value
}
To display this data in an expandable format on a webpage, I want to create one expansion panel for each "key". Each panel will contain a table with no headers as shown below:
(accordion) key 1
Opening the panel will reveal the table with the corresponding data in "key1"
subkey 1 | value
subkey 2 | value
subkey 3 | value
(another accordion) key2
subkey 1 | value
subkey 2 | value
subkey 3 | value
subkey 4 | value
subkey 5 | value
I need guidance on how to properly store the retrieved data in variables within the .ts file and how to format everything using HTML.