我有你的json文件,例如:
{
"properties": [
{
"id": "title",
"label": "Title",
"tooltip": "Title",
"type": "MultiChoice",
"viewMode": "edit",
"required": true,
"choices": [
{
"text": "Mr",
"value": "Mr"
},
{
"text": "Mrs",
"value": "Mrs"
},
{
"text": "Miss",
"value": "Miss"
}
],
"value": null
},
{
"id": "firstName",
"label": "First Name",
"tooltip": "First Name",
"type": "Text",
"length": 128,
"required": true,
"viewMode": "edit",
"value": null
},
],
"actions": [
{
"id": "save",
"label": "Save"
},
{
"id": "cancel",
"label": "Cancel"
}
]
}
我需要将这个json文件转换为angular2形式:它看起来像:
<form>
<input type="checkbox" name="Mr" value="Mr"> Mr<br>
<input type="checkbox" name="Mrs" value="Mr"> Mrs<br>
<input type="checkbox" name="Mr" value="Miss> Miss<br>
FirstName:
<input type="text">
<input type="button" >save <br>
<input type="button" >cancel<br>
</form>
然后当用户编辑此表单时我需要更新json文件中的值,任何人都知道如何开始至少解决这个问题? 使用angular2 +和html5