Reputation: 65870
I need to load <ion-select>
dynamically.It is working fine.Now I need to set default selection.I have used selected
attribute for that.But it is not working.Can you tell me why?
Here is the Plunker
app/home.page.html
<ion-item>
<ion-label>Donation</ion-label>
<ion-select>
<ion-option *ngFor="let date of donationDates" value="{{date.donationdate}}" selected="date.isChecked">
{{date.donationdate}}</ion-option>
</ion-select>
</ion-item>
app/home.page.ts
export class HomePage {
donationDates:any=[];
constructor(public navController: NavController) {
this.donationDates = [
{
id: null,
donationid: "2",
donationdate: "2017-03-12",
datedescription: "Vad Bij",
isChecked:true
},
{
id: null,
donationid: "2",
donationdate: "2017-03-19",
datedescription: "Sud satam",
isChecked:false
}]
}
}
Upvotes: 1
Views: 345