I have a formarray in the form, Need to hide and show based on dropdown value - is_dependent_exist
I have tried like below:
var all_user_custom_fields = [
{
'field_name_slug': 'radio_button_with_group_custom_field8',
'is_dependent_exist': 0
},
{
'field_name_slug': 'radio_button_with_default_value',
'is_dependent_exist': 1
},
{
'field_name_slug': 'radio_button_with_mandatory',
'is_dependent_exist': 1
},
{
'field_name_slug': 'check_box_with_mandatory',
'is_dependent_exist': 0
}
];
<div *ngFor="let CustomUser of custom_field_dataArray.controls; index as c;" [formGroupName]="c" class="col-12 md:col-6 lg:col-4
*ngIf="all_user_custom_fields[c]?.is_dependent_exist != 1">
<input formControlName="{{all_user_custom_fields[c]?.field_name_slug}}" type="text" (keyup)="validate($event, c, all_user_custom_fields[c]?.field_name_slug)" pInputText />
</div>
Getting issue like Property 'c' does not exist on type 'UsersComponent'.
I need to display only is_dependent_exist = 0 value fields