<ion-option *ngfor> inside <ion-select> error


My object is:

But when i run this template:

<div *ngIf="question.units.length>1">
        <ion-select [(ngModel)]="Answers[i]" interface="action-sheet" cancelText="{{'cancel'|translate}}">
            <ion-option *ngFor="let unit of question.units" [value]="unit.UNIT_FACTOR" [selected]="unit.TYPE=='primary'? 'true':'false'">{{unit.TITLE}}</ion-option>
<div *ngIf="question.units.length<=1">

It show all item seperated by “,”?
And click to chose item, it selected all?

When i tested without *ngFor, it’s worked.
Please help me to correct the template.
Thank you so much.


@zakton5 please help!


@joshmorony, @rapropos please help me to solve this problem


Coud it be that unit_factor is always 1?


yes, two unit.UNIT_FACTOR is 1, so what does it mean?


I think value must be unique in the select. So try to use the index of the array as value.


Thank you, when i remove [value]=“unit.UNIT_FACTOR” it’s work.