I have list that gets filled up with 'allergies' that it fetches from a web service. So allergies could look something like this:
$scope.formData.allergies = [
{
'id' : 1,
'description' : 'Potassium Cyanide'
},
{
'id' : 2,
'description' : 'Blue ring octopus'
},
{
'id' : 3,
'description' : 'Poison dart frog'
},
];
Which then gets used to populate a list of checkbox inputs:
<li class="item item-checkbox" ng-repeat="allergy in formData.allergies">
<label class="checkbox">
<input type="checkbox" name="selectedAllergies" value="allergy.id">
</label>
{{allergy.description | uppercase}}
</li>
But I'm struggling on how to find out what the user actually selected? Doing this after the user selected a few:
console.log($scope.selectedAllergies);
just returns undefined...