last step
This commit is contained in:
@@ -18,8 +18,12 @@ export class Home {
|
||||
filteredLocationList: HousingLocationInfo[] = [];
|
||||
|
||||
constructor() {
|
||||
this.housingLocationList = this.housingService.getAllHousingLocations();
|
||||
this.filteredLocationList = this.housingLocationList;
|
||||
this.housingService
|
||||
.getAllHousingLocations()
|
||||
.then((housingLocationList: HousingLocationInfo[]) => {
|
||||
this.housingLocationList = housingLocationList;
|
||||
this.filteredLocationList = housingLocationList;
|
||||
});
|
||||
}
|
||||
|
||||
filterResults(text: string) {
|
||||
@@ -27,6 +31,8 @@ export class Home {
|
||||
this.filteredLocationList = this.housingLocationList;
|
||||
return;
|
||||
}
|
||||
this.filteredLocationList = this.housingLocationList.filter((housingLocation) => housingLocation?.city.toLowerCase().includes(text.toLowerCase()),);
|
||||
this.filteredLocationList = this.housingLocationList
|
||||
.filter((housingLocation) => housingLocation?.city.toLowerCase()
|
||||
.includes(text.toLowerCase()),);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user