Show and hide form element using Angular2 DevExtreme

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>
链接地址: http://www.djcxy.com/p/5244.html

上一篇: 行过滤器始终显示查找列的选择框

下一篇: 使用Angular2 DevExtreme显示和隐藏表单元素