formio / angular

JSON powered forms for Angular
https://formio.github.io/angular-demo
MIT License
646 stars 472 forks source link

[Question] replace ng-show in Item Template with *ngIf not working #755

Closed blackbaud-RickSchnitzler closed 2 years ago

blackbaud-RickSchnitzler commented 3 years ago

We have gone from "ng-formio": "2.19.6" and "ng-formio-builder": "2.19.4" to "angular-formio": "4.9.6"and "formiojs": "4.11.3" for our Angular9 SPA. The Item Template for ChoicesJS looks like this.

<div>
  <div style="font-weight: bold">
    {{ item.Name }}
  </div>
</div>

<div class="search-recipient">
  <div ng-show="item.CanadianCharityNumber">Canadian Charity Number:  {{ item.CanadianCharityNumber }}</div>
  <div>{{ item.Address }}</div>
</div>

We've tried replacing ng-show with *ngIf and with [hidden] with no success. We have also tried changing Widget Type to HTML 5 and other properties. Tried scss solutions also to no avail. Inspecting the ng-form version, I've noticed that class=".ng-hide" was added to the div by ng-formio I believe when there should not show.

We want the rows to be hidden if there is no data. Anyone have a solution?

wag110894 commented 2 years ago

Hello @blackbaud-RickSchnitzler, are you still able to replicate this issue on your side? If so, can you try testing against the latest version of Angular (5.2.2)?

Thank you.

blackbaud-RickSchnitzler commented 2 years ago

Yes. I just updated from angular-formio:4.12.0 to @formio/angular 5.2.2 and formiojs:4.14.0 to formiojs:4.14.3. I now see Canadian Charity Number: null I haven't tried anything but the ng-show and haven't tried other. Inspecting shows.

Canadian Charity Number: null