I'm trying to show and hide a form field using Angular's *ngIf but, when I do, the entire form doesn't render no matter the value I give the *ngIf and no errors are thrown. Clearly the *ngIf isn't the way to go. Is there a more DevExtreme way to do this? I see there is a visible in the documentation but I don't just want to hide it.
HTML
<dx-form id="companyDetailsForm" [(formData)]="company" [showColonAfterLabel]="false">
<dxi-item dataField="Name">
<dxi-validation-rule type="required" message="Name is required"></dxi-validation-rule>
</dxi-item>
<dxi-item *ngIf="hasParent" dataField="Parent" caption="Parent">
<dxo-label text="Parent"></dxo-label>
</dxi-item>
</dx-form>
Use visible property instead, *ngIf does not work in the DX Form.
<dxi-item [visible]="hasParent"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With