I need to be bundle selected checkboxes together to POST to my server. In each checkbox's attributes, I'm storing some two important values: "pos" (part of speech), and definition. I need to run through each of these checkboxes, push it to a JSON array, and send it off when the "Add Word" button is pressed.
<input type="checkbox" name="definition-checkbox" pos="noun" definition="Hill, rolling grassland" class="ng-valid ng-dirty">
I've thought of turning the checkboxes into element-restricted directives and somehow doing something there, but I'm not sure how to go about getting all the values here, without doing some loop through them all which seems non-Angular.
Any advice?
Copyright Notice:Content Author:「freedomflyer」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/16493575/get-all-selected-checkboxes-and-their-associated-attributes-using-angular