用角度6中的json文件创建动态表单

时间:2018-09-07 14:42:13

标签: json angular typescript

我想用json对象创建动态表单。

我正在使用以下示例:https://medium.com/@mail.bahurudeen/create-a-dynamic-form-with-configurable-fields-and-validations-using-angular-6-994db56834da 但这不符合我的要求。 有想法吗?

"Form": {
"LabelId": "label",
"GlobalSelection": {
  "GlobalAnswer": [
    {
      "GlobalListeResponse": " AllYes  ",
      "ListeResponse": " Yes "
    },
    {
      "GlobalListeResponse": " AllNo  ",
      "ListeResponse": " No "
    }
  ]
},
"Question": [
  {
    "QuestionId": " Q1  ",
    "LabelId": " Q1 ",    
    "Rank": " 1 ",
    "Answer": {
      "Type": " Radio ",
      "Length": " 2 ",
      "ListeResponse": [
        "Yes ",
        "No  "
      ],
      "Code": [
        {
          "CodeName": " Yes ",
          "Value": " YES "
        },
        {
          "CodeName": "No ",
          "Value": " NO "
        }
      ],
      "MultiChoice": " 0 ",
      "Editable": " 1 "
    },
    "IsMandatory": " 1 "
  },{...},{...}]  }}

0 个答案:

没有答案