The code view below is what I am currently working with:
<tr ng-repeat="c in clients | orderBy:'code'">
<td>{{c.firstname}} {{c.lastname}}</td>
<td>{{c.telephone}}</td>
<td>{{c.location}}</td>
<td>{{c.code}}</td>
</tr>
I am looking to dynamically change the orderBy
parameter when a column is clicked. For example, if a user clicks on the location column, I want the orderBy
condition to switch to 'location' instead of 'code'. The updated form should look like this:
<tr ng-repeat="c in clients | orderBy:'location'">