Я хочу создать динамический HTML из ответа JSON, поступающего с сервера,
Например: допустим, ответ json от сервера:
param_data: any = {
"fields": [
{ "type": "text", "name": "firstname", "label": "label", "required": true, "data": "", "frmctrlnm": "labelone" },
{ "type": "button", "name": "firstname", "label": "label two", "required": true, "data": "", "frmctrlnm": "labeltwo" },
{ "type": "input", "name": "Red", "label": "input", "required": true, "data": "", "frmctrlnm": "inputone" },
{ "type": "input", "name": "BLue", "label": "input", "required": true, "data": "", "frmctrlnm": "inputone" },
{ "type": "label", "name": "color_id", "label": "input two", "required": true, "data": "", "frmctrlnm": "inputtwo" },
{ "type": "select", "name": "select", "label": "select", "required": true, "data": "", "frmctrlnm": "select" }
]}
В зависимости от типа, поступающего с сервера, я хочу создать html-компонент, а при щелчке по кнопке я хочу тот же json с обновленными данными пользователя в полях.
Можно этого добиться?
Заранее спасибо!