Hi have two radio groups, and i want the values to update when i change one of the radio group value, beause they are both conected.
If i change the first radio group value, i want the second radio group to update.
HTML:
<ion-radio-group [(ngModel)]="cardOrderNumber" (ionChange)="updateCardOrdersNumber($event)">
<ion-list-header>
<ion-label>{{'component.loyaltyCard.numberOfOrdersNeeded' | translate}}</ion-label>
</ion-list-header>
<ion-item>
<ion-label>6</ion-label>
<ion-radio slot="start" color="success" [value]="6"></ion-radio>
</ion-item>
<ion-item>
<ion-label>8</ion-label>
<ion-radio slot="start" color="success" [value]="8"></ion-radio>
</ion-item>
</ion-radio-group>
<ion-radio-group (ionChange)="updateCardTittle($event)">
<ion-list-header>
<ion-label>{{'component.loyaltyCard.cardTitle' | translate}}</ion-label>
</ion-list-header>
<ion-item>
<ion-label>Encomende {{cardOrderNumber +1}} pague {{cardOrderNumber}}</ion-label>
<ion-radio slot="start" color="success" value="Encomende {{cardOrderNumber +1}} pague {{cardOrderNumber}}"></ion-radio>
</ion-item>
<ion-item>
<ion-label>Pague {{cardOrderNumber}} receba 1 grátis</ion-label>
<ion-radio slot="start" color="success" value="Pague {{cardOrderNumber}} receba 1 grátis"></ion-radio>
</ion-item>
</ion-radio-group>
ts:
updateCardOrdersNumber(number1){
this.cardOrderNumber = number1.detail.value;
this.cardSquareArray.length = this.cardOrderNumber;
this.orderRow1.length = this.cardOrderNumber / 2;
this.orderRow2.length = this.cardOrderNumber / 2;
}
updateCardTittle(tittle){
this.cardTittle = tittle.detail.value;
}
if i change the value of the first radio group, i want the second group value to be updated, because the text of the second group changes when the first radio group value changes.
WHat is the logic that i have to do to update when the first group changes?
