When the page initially loads, there is a dropdown with the default placeholder "Select Person Type" and a checkbox list displaying all persons by default.
An angular filter is used to display only the selected type of persons from the dropdown (working perfectly). However, when the placeholder "Select Person Type" is chosen after filtering, the checkbox list becomes empty.
<select class="form-control" id="personId" data-ng-model="personModel.personTypeID" name="selectPersonType"
ng-options="person.personTypeUniqueID as person.personTypeEn for person in personTypes | orderBy:'personTypeEn' ">
<option value="">Select person type</option><br></select><div ng-repeat="person in persons|orderBy:'name'|filter: { personTypeID: personModel.PersonTypeID }|filter:searchperson" style="display:flex;padding-left:5px"><
<input style="min-width:13px !important;" class="checkbox" id={{person.personUniqueId}} type="checkbox" ng-checked="selectedOptionPerson.indexOf(person.personUniqueId)> -1" ng-click="toggleSelection($event)" ng-model="option.optionPersonModel[$index]">{{person.name}}
</div>
The issue may be occurring because the filtering is based on PersonTypeID which the placeholder does not have. Is there a way to display the entire list of persons when the placeholder is selected again?
To clarify, I want to show all persons after selecting the placeholder following filtering by person type.
Thank you for your assistance and any suggestions are appreciated.