I've placed as options in ion-select, Zone South, North, Center and West. I want when I click on any option, only show the information of that zone taking the information from the database. At the moment I only have the same select.
<ion-item no-lines class="setaselect">
<ion-label stacked color="carioca" >REGIÕES</ion-label>
<ion-select>
<ion-option value="opt1"></ion-option>
<ion-option value="opt2">Zona Oeste</ion-option>
<ion-option value="opt3">Zona Norte</ion-option>
<ion-option value="opt4">Zona Sul</ion-option>
</ion-select>
DB.ts
getRegiao(pregiao: string){
return new Promise<Regiao[]>((resolve, reject) => {
let sql = "select * from tb_regiao" + pregiao;
console.log(sql);
this.executeQuery(sql).then(data => {
let regioes = [];
data.forEach(function (row) {
let regiao: Regiao = { nom_regiao: row[0]}
regioes.push(regiao);
});
resolve();
}).catch(error => {
console.log(error);
});
});
}
and my ts function.
selecionaregiao(pregiao: string) {
this.db.getRegiao(pregiao)
.then(data => this.regioes = data)
.catch(error => console.log('Something want wrong!'));
}
But I do not know exactly how I do it, nor can I search exactly what I want. As I am still learning, I decided to ask for this information here: D
If anyone knows how I do this, or some tutorial, I really do not know how to search how to do this.