I need help with filtering books in an online library project using a modal page. The modal has 3 input fields for title, author, and year. How can I filter the books based on these inputs?
Here is a snippet of my modal.html code:
<ion-content padding>
<ion-list>
<ion-item>
<ion-label color="primary">Title</ion-label>
<ion-input placeholder="Insert the title" [(ngModel)]="searchTerm" name="titlebook"></ion-input>
</ion-item>
<ion-item>
<ion-label color="primary">Author</ion-label>
<ion-input placeholder="Insert the Author" name="authorbook"></ion-input>
</ion-item>
<ion-item>
<ion-label color="primary">Year</ion-label>
<ion-input type="number" placeholder="Insert the Years" name="anno"></ion-input>
</ion-item>
</ion-list>
<ion-buttons text-center>
<button ion-button color="secondary" (click)="searchTitle()">save</button>
</ion-buttons>
Example of JSON data for one book from my collection (100 books):
{
"id":"3",
"author": "Dante Alighieri",
"country": "Italy",
"imageLink": "images/the-divine-comedy.jpg",
"language": "Italian",
"link": "https://en.wikipedia.org/wiki/Divine_Comedy\n",
"pages": 928,
"title": "The Divine Comedy",
"year": 1315
},