朋友们尝试了所有可能的方法来获取ionselect中的serach bar无法在选择框中获取离子搜索栏试图从html和tsfile获取让我知道是否有可能获得ionserach in ion选择
## another way tried in ts file code ##
this.countryAlertOpts= {
inputs: [
{
name: 'title',
placeholder: 'Title'
},
],
buttons: [
{
text: 'Cancel',
handler: data => {
console.log('Cancel clicked');
}
},
{
text: 'Save',
handler: data => {
console.log('Saved clicked');
}
}
]
};
## htmlcode ##
<ion-item> <ion-label>Select Country</ion-label>
<ion-searchbar name="countrysearch" [ngModel]="countrysearch" (ngModelChange)="searchCountries($event)" placeholder="Serach for Countries"></ion-searchbar>
<ion-select [(ngModel)]="country" interface="popover" name="country" (ngModelChange)="getStates($event)">
<ion-option *ngFor="let c of countries" value="{{c.id}}" [selected]= "c.id == this.country">{{c.name}}</ion-option>
</ion-select> </ion-item>