I have a table of text elements, each of which contains a description and a checkbox. Now I need to add an uber-checkbox that will either clear or mark all the fields. The current code is shown below when my first attempt to highlight the solution.
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-bordered"> <tr id="myBlusteringAttempt"> <td width="90%"> <p>Clear/Check all options</p> </td> <td width="10%" align="center" valign="middle"> <input type="checkbox" ng-change="toggleCheckboxes()"> </td> </tr> <tr id="existing-code-that-works" ng-repeat="declaration in LegalDeclaration.ReplacementOfPolicy.ReplacementPolicyDeclarations"> <td width="90%"> <p>{{declaration.DeclarationText}}</p> </td> <td width="10%" align="center" valign="middle"> <input type="checkbox" ng-model="declaration.AcceptDeclaration"> </td> </tr> </table>
Perhaps I could have done this with jQuery so easily, but I would have preferred to use the Angular jQuery facade and prevent the framework from being used improperly.
Profk source share