Issue
This is my ionic code which I wrote for ion-select
<ion-item lines="none" type="input">
<ion-label position="stacked" color="primary">Skill level</ion-label>
<ion-select
[formControl]="selectedSkill"
color="white"
class="ion-padding-start" value="{{ student.level }}">
<ion-select-option *ngFor="let level of levels" value="{{ level }}" color="primary">
{{ level }}
</ion-select-option>
</ion-select>
</ion-item>
The default value is working fine when I click the select element once. But it is not prefilled once I open the page.
Solution
The problem is I haven't initiated the levels array. After I have added an empty array it is working fine.
Answered By - Ragesh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.