I am using the following code:
<input type="checkbox" value="{{F}}" ng-model="IsChecked" ng-change="ModifyFilter(IsChecked,$index)">{{F}}
with the Controller:
$scope.ModifyFilter = function (IsChecked, index) {
if (IsChecked) {
$scope.ActiveFilters.push($scope.Filters[index]);
} else {
var indexz = $scope.ActiveFilters.indexOf($scope.Filters[index]);
$scope.ActiveFilters.splice(indexz, 1);
}
$scope.ApplyFilter();
};
This works fine, however I am unable to deselect my checkboxes. This is in the browser and iOS when built with ionic.
There is no need to send IsChecked to the function. Simply write in controller $scope.IsChecked. However create a $scope.CheckboxValue in controller, bind that variable in ng-model and modify $scope.CheckboxValue accordingly to your logic. Hope this helps.