在AngularJs中使用“依赖项”json模式(版本:draft-v4)不起作用

时间:2018-01-30 10:15:25

标签: javascript angularjs json jsonschema json-schema-validator

我有这个架构:

 {
      "title": "Test dependncies",
      "description": "This a test to show how we can use dependencies in json schema",
      "properties":{
          "graduate": {
              "title":"Graduate?",
              "type":"string",
              "enum":["Yes","No"],
               "options": {
               "dependencies":[
                  {"id":"minimumEligibilityAge","value":"Yes"},
                  {"id":"courseName","value":"No"}
                  ]
               }
          },
          "minimumEligibilityAge":{
              "id":"minimumEligibilityAge",
              "title":"Enter Age",
              "type":"number",
              "options":{"hide_display":true}
              },
          "courseName":{
              "id":"courseName",
              "title":"Enter Graduation Course Name",
              "type":"string"
          }
      },
      "type": "object"
    }

我可以使用Angular-schema-form生成表单。

预期行为

minimumEligibilityAge & courseName 根据属性的值隐藏/显示。但它没有工作&我没有错误。

0 个答案:

没有答案