After receiving an API response, the product's variety details are displayed, with each item being assigned a unique identifier. For example, 0 signifies size and 1 represents color. To facilitate selection, radio buttons are provided:
<section class="example-section" *ngFor="let attr of Attr" >
<mat-radio-button *ngFor="let checkbox of attr.items.split(',')"
[name]="attr.attr_slug" (click)="onClick(checkbox)" [value]="model[attr.attr_slug]"
class="example-margin">{{checkbox}}</mat-radio-button>
</section>
The challenge lies in obtaining pairs of selections, such as (s, yellow) or (m, yellow), instead of just individual values. Attempts using a model to store the selections have resulted in only a comma being logged out. How can this be resolved?