I just started with AngularJS and I'm trying to make a users table that shows the users for the application and the roles they are in (e.g. Admin, Editor, Anon) with checkboxes to take the users in and out of roles.
<tbody>
<tr data-ng-repeat="item in pagedItems[currentPage] | orderBy:sortingOrder:reverse">
<td class="table-item-title"><a title="{{item.UserName}}" href="" ng-click="loadEditForm(item.UserName)">{{item.UserName}}</a></td>
<td class="hmax479">{{item.Email}}</td>
<td align="center" data-ng-repeat="role in roles" style="align:center;">
<input type="checkbox" data-ng-model="role.IsChecked" style="align:center;"/>
</td>
</tr>
</tbody
With the above code it updates the checkboxes for the entire group based on the last user that was clicked rather than for a single user. Is there any way I can change this code with something like a "user in users" ng-repeat to change this or do I need to add a new function in the controller?
rolesis separate frompagedItems. Do you have aitem.roles=[]to keep track of each user's roles?