I am trying to write a logic to handle ngswitchcase for the json response which have multiple objects.
Is it possible to handle the object inside the ngswitch and how?
I would like to make dynamic form based on the JSON.
For Example:
For this input form-control should be: option1 option1_text_box option2 option2_select_option option3 option3_select_option
options = [
{
'option_text': "option1",
'secondary_element': {
"text_box":{
"name":"a1"
}},
},
{
'option_text': "option2",
'secondary_element': {
"select":{
"select_type":"single",
"options":["a1","a2","a3"]
}},
},
{
'option_text': "option3",
'secondary_element': {
"select":{
"select_type":"multiple",
"options":["b1","b2","b3"]
}},
},
];
the FormGroup should be here is my stackblitz