|
@@ -40,9 +40,9 @@ export class HomePage implements OnInit {
|
|
|
|
|
|
onSearch(event: any) {
|
|
onSearch(event: any) {
|
|
const query = event.target.value.toLowerCase();
|
|
const query = event.target.value.toLowerCase();
|
|
- this.filteredItems = this.items.filter(item =>
|
|
|
|
- item.title.toLowerCase().includes(query) ||
|
|
|
|
- item.description.toLowerCase().includes(query)
|
|
|
|
|
|
+ this.filteredItems = this.items.filter(item =>
|
|
|
|
+ (item.title && item.title.toLowerCase().includes(query)) ||
|
|
|
|
+ (item.description && item.description.toLowerCase().includes(query))
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|