@mdline wrote:
Hello,
I want to filter in my searchbar but the filter does not work. But the entries are displayed correctly.
filter(searchbar) { let inputText = searchbar.srcElement.value; if (!_.isNil(inputText)) { let allApartmentMap= this.allApartmentMap; this.apartmentMap.forEach(function (persons, apartmentname, map) { let allPersons= allApartmentMap.get(apartmentname); persons= _.filter(allPersons, function (p) { return _.includes(p.name, inputText) || _.includes(p.address), inputText) || }); }); } } <ion-list> <div *ngFor="let ap of apartmentMap.keys()"> <ion-list-header> {{ap}} </ion-list-header> <ion-item *ngFor="let person of apartmentMap.get(ap)"> {{ person.name}}<br> {{ person.address}}<br> </ion-item> </div> </ion-list>
Posts: 1
Participants: 1