ngx-schema-form icon indicating copy to clipboard operation
ngx-schema-form copied to clipboard

JSON Schema validation

Open Amel92 opened this issue 5 years ago • 2 comments

Hello,

I am looking for a solution to show an element according to an interval of another, i know i have to use the visibleif condition but it seems to be not applyable in such case :/

for example : 'X': { 'type': 'number', 'description': 'X ? :', }, 'Y': { 'type': 'number', 'description': 'Y ? : ', 'visibleIf': { what condition can be used here to make a check if X >= 400 then show Y else hide it ?? } }

I hope some can figure it out ;) Thanks in advance.

Amel92 avatar Jun 11 '19 14:06 Amel92

Currently only an exact value and $ANY are supported.

In consequence this would require to create up to 400 comparison statements in your visibleIf property.

I agree with you that an handling for most common expression like <,<=,>,>=, etc... would be usefull here.

Someone should make a feature request out of this issue.

daniele-pecora avatar Jul 20 '19 07:07 daniele-pecora

I have taken action into this with commit a1bcc9c . With this pull request the comes the support for expression in the visibleIf condition. See also README.MD

daniele-pecora avatar Jul 28 '19 09:07 daniele-pecora