Hello ,
i have build a “livesearch”. When i type a letter, the search results will be updated instantly.
But in this example they are way more results than the shown 4 listed, but they are not visible. I can click on the invisible items an they behave like the others 4.
My HTML Code:
<ion-searchbar [(ngModel)]="searchQuery" (input)="typing(searchQuery)" placeholder="search"> </ion-searchbar>
<ion-card>
<ion-list>
<ion-item *ngFor="let name of namesShown" [(ngModel)]="selected" (click)="ListItemClick(name)">
{{ name }}
</ion-item>
</ion-list>
</ion-card>
My ts File:
public names: String[] = [];
public namesShown: String[] = [];
public typing($value) {
this.namesShown = this.names.filter((s: String) => s.match(new RegExp($value, "i")));
}
Thank you in advance