Mam tabelę elementów tekstowego pola wyboru, każdy z opisem i polem wyboru. Teraz muszę dodać pole wyboru uber, które wyczyści lub sprawdzi wszystkie pola. Obecny kod jest pokazany poniżej, z moją pierwszą próbą wyróżnienia rozwiązania.Przełącz wszystkie pola wyboru Angular w grupie
<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>
Mógłbym pewnie tak łatwo to zrobić z jQuery, ale wolałbym użyć jQuery fasadę kątowej, a niech nie będzie krzyżowanie ras ram.
jest 'declaration.AcceptDeclaration' z NG-repeat będzie przełączyć ustawienie' metody toggleCheckboxes'? –
@pankajparkar Albo z tej metody, albo w jaki sposób znajduję, która działa, z pomocą tutaj. – ProfK