When choosing the option, its value will be stored in a variable, how will it be get value
driver.html
<ion-item>
<ion-select interface = "popover">
<ion-option *ngFor="let cg of routeData; let i = index;" value="{{i}}">{{cg.routeName}}</ion-option>
</ion-select>
</ion-item>
driver.ts
getRoute() {
this.storage.get('token').then((tkn) => {
this.headers.token = tkn;
console.log("token Data: " + this.headers.token);
this.driverProvider.getRoute(this.headers)
.then(result => {
if (JSON.parse(result.text()).response == "OK") {
this.routeData = JSON.parse(result._body).stops;
console.log("Route Name : " + JSON.stringify(this.routeData)) ;
} else {
this.err = JSON.parse(result.text()).res;
}
}, (err) => {
console.log("Error is: " + err);
});
});
}