1

I would like to display radio buttons based on the input of a table. If the value of the check box is contained on the other table, the check box will be checked otherwise the checkbox will display normally

This is my code:

 <div *ngFor="let item of prelevementToDisplay">
  <ion-list radio-group *ngFor="let type of normePrelevementList; let i = index" [(ngModel)]="checkNorme">              
      <div *ngIf="type.name === item.normePrelevement">
        <ion-item>
          <ion-label>{{type.name}} </ion-label>
          <ion-radio [checked]="true"  value="{{type.name}}"></ion-radio>
        </ion-item>
      </div>

      <div *ngIf="type.name!== item.normePrelevement">
                <ion-item>
                  <ion-label>{{type.name}}</ion-label>
                  <ion-radio value="{{type.name}}"></ion-radio>
                </ion-item>
      </div>
</div>

How can I resolve this problem?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Hamdy
  • 430
  • 1
  • 6
  • 19

1 Answers1

1

You have a missing closing <ion-list> in your question. Perhaps that's it.

Also FYI there is an else to *ngIf too. See this example

And === is preferred over == Ignore the comment.

Community
  • 1
  • 1
JGFMK
  • 8,425
  • 4
  • 58
  • 92