I have a few checkboxes:
Using a string of $index
can help to use a hashmap of selected values:
-
This way the ng-model object gets updated with the key representing the index.
$scope.someObject = {};
After a while $scope.someObject
should look something like:
$scope.someObject = {
0: true,
4: false,
1: true
};
This method won't work for all situations, but it is easy to implement.