NG Dynamic Forms Version: `18.0.0`
[ ] Basic UI
[ ] Bootstrap UI
[ ] Foundation UI
[ ] Ionic UI
[ ] Material
[ ] NG Bootstrap
[X ] Prime NG
Description
Use case
I want to show/hide some fields based on the value of other fields (selectModel) which has custom object as options/values.
Problem
The DynamicFormRelationService does the relations match on the matchesCondition function using strict equality which when comparing objects returns false.
Proposed Solution
Add an optional function called matched to the DynamicFormControlCondition which, in case it is defined, it will take precedence over the current value property.
export interface DynamicFormControlCondition {
id?: string;
rootPath?: string;
status?: string;
value?: any;
matched?: (relatedFormControlValue: any) => boolean; // Has precedence over value
}
I'm submitting a
I'm using
Description
Use case
I want to show/hide some fields based on the value of other fields (selectModel) which has custom object as options/values.
Problem
The DynamicFormRelationService does the relations match on the matchesCondition function using strict equality which when comparing objects returns false.
Proposed Solution
Add an optional function called matched to the DynamicFormControlCondition which, in case it is defined, it will take precedence over the current value property.
This way we can match the value correctly.