Ion-select value get on load of page

        <ion-col><ion-select [(ngModel)]="times" (ionChange)='onTimeChange(times)'>
            <ion-option value="lastweek">Last 1 Week</ion-option>
            <ion-option value="lastmonth">Last 1 Month</ion-option>
            <ion-option value="last3month">Last 3 Month</ion-option>
            <ion-option value="lastyear">Last 1 Year</ion-option>
            <ion-option value="alltime">All time</ion-option>
        </ion-select></ion-col>

now i want the default selected value in my ts file for on load of page???

Assign to times and stop posting dupes.

2 Likes
<ion-select [(ngModel)]="times" (ionChange)='onTimeChange(times)'>
            <ion-option value="lastweek">Last 1 Week</ion-option>
            <ion-option value="lastmonth">Last 1 Month</ion-option>
            <ion-option value="last3month">Last 3 Month</ion-option>
            <ion-option value="lastyear">Last 1 Year</ion-option>
            <ion-option value="alltime">All time</ion-option>
        </ion-select>      

times: string = 'lastweek';

If you have some spare time left, make use of the search functionality. It will probably learn you lots of things and save us some time :slight_smile:

2 Likes

Thank you its working now… actually i am totlly new in ionic …