I am having some difficulty with my AngularJS filters when using a checkbox for filtering. Here is an example of the checkbox code:
<div class="col-sm-2" style="text-align: right">
<label for="include-deleted-search" class="control-label">Include Deleted</label>
</div>
<div class="col-sm-2">
<input ng-model="search.includeDeleted" type="checkbox" id="include-deleted-search"/>
</div>
I am trying to filter airlines based on whether they are deleted (and includeDeleted is true) or not deleted.
Although, I am facing issues with the { isDeleted: search.includeDeleted } filter in my table.
<table class="table table-hover table-striped table-bordered">
<thead>
<tr>
<th>Ariline ID</th>
<th>Airline Name</th>
<th>Country</th>
<th>Telephone</th>
<th>24hr Telephone</th>
<th>Email Address</th>
<th>Deleted</th>
</tr>
</thead>
<tr dir-paginate="airline in airlines | filter: { airlineName: search.airlineName||'' } | filter: { country: search.countryName||'' } | filter: { isDeleted: search.includeDeleted||!isDeleted } | itemsPerPage: pageSize" current-page="currentPage">
<td>{{ airline.airlineId }}</td>
<td>{{ airline.airlineName }}</td>
<td>{{ airline.country }}</td>
<td>{{ airline.telephoneNumber }}</td>
<td>{{ ariline.telephone24Hour }}</td>
<td>{{ airline.emailAddress }}</td>
<td>{{ airline.isDeleted }}</td>
</tr>
</table>
I'm looking for suggestions on how to create a proper filter condition for this scenario. Would it be necessary to write a custom filter? All other functionalities are working correctly.