角度json模式表单布局条件下的多重限制

时间:2019-09-12 19:21:45

标签: json angular angular6-json-schema-form

我们可以在angular json模式表单布局的条件部分中添加多个限制吗?

$scope.schema = {  
        "type": "object",  
        "title": "Comment",  
        "properties": {  
            "name": {  
                "title": "Name",  
                "type": "string"  
            },  
            "email": {  
                "title": "Email",  
                "type": "string"  
            },  
          "department: {  
           "type" : "string"  
          }   
        }  
    };  
    $scope.form = [  
        "name",  
        {key: "email",  
            condition: "model.name=='abc' && model.department == 'xyz'"  
        },  
        {  
            "type": "submit",  
            "style": "btn-info",  
            "title": "OK"  
        }  
    ];  
    $scope.model = {};  
});

0 个答案:

没有答案