I am using checkboxes within a modal to narrow down my search results. However, I have encountered an issue where when I check multiple checkboxes and then close the modal, the checked inputs become unchecked.
Every time I open the modal, I want the checked inputs to remain checked.
var filterTemps = [
"partial/uicomponent/mdlFilters/mdl.estateType.filter.html",
];
$scope.showReleventMdl = function(num){
var filtersModal = $modal({
backdrop:true,
placement:'top',
templateUrl : filterTemps[num],
controller : 'filterCtrl',
show: false
});
filtersModal.$promise.then(filtersModal.show);
};
<!-- Trigger the function to call the modal -->
<ul class="nav navbar-nav">
<li>
<a href="" ng-click="showReleventMdl(0)" ng-bind="string.pages.form.estateType"></a>
</li>
...
</ul>
--------------------------------------------------
<!-- My Modal Template -->
<div class="modal-body">
<ul class="filterList">
<li class="filterListItem half" ng-repeat="item in string.pages.mainPage.estateTypes">
<input id="estateType{{$index}}" ng-click="checked(item)" type="checkbox" class="filterCheck">
<label for="estateType{{$index}}" ng-bind="item"></label>
</li>
</ul>;
</div>;
Is there a way to store the checked inputs and bring them back in a checked state when re-opening the modal? Thank you!