I have a table in my HTML code in which the rows are generated by AngularJS ng-repeat. Each row contains a checkbox in the first column and other data in the corresponding columns. I am trying to mark all checkboxes as selected when this button which is present in another div is clicked.
<tbody>
<tr ng-repeat="row in myObject track by $index" ng-class-even="'alternate-row'">
<td name="checkbox">
<input type="checkbox" ng-model="row.checked" ng-style="row.checkboxStyle" ng-click="setSelectedRow(row)" />
</td>
<td>{{ row.data1 }}</td>
<td>{{ row.data2 }}</td>
</tr>
</tbody>
The button is as follows:
<div class="btn-group">
<button type="button" id="selectAll" class="btn btn-default" title="Select All" ng-click="selectAllGrid()">Select All</button>
</div>
A method is called on the click of the checkbox that adds that particular row to an array. How will that method be called if I mark the checkbox as checked on click of the button.