@AishApp wrote:
Searchbar working fine in version ionic 2 alpha 42 throws console error as "error during evaluation of input" on entering data. (Checked with version alpha 46 and alpha 47). Below is my html code which was working fine.
<ion-searchbar [(ngModel)]="searchQuery"></ion-searchbar> <ion-list #list class="searchList"> <ion-item *ngFor="#result of searchResult()"> <ion-thumbnail item-left> <img data-src="img/{{result.pic}}"> </ion-thumbnail>
My Ts:
searchResult(){
var query = this.searchQuery;
if(query.trim() == ''|| query.length <= 2){
return null;
}
return this.data.filter((myItem) => {
if(myItem.toLowerCase().indexOf(query.toLowerCase()) >= 0) {
return true;
}
return false;
})
}Please help by letting me know what changes to be done to make it work fine in current version. Thanks in advance.
Posts: 2
Participants: 2