Home AngularJS - Sorting data ascending / descending when column is clicked
 I have the following view code: 
 I want to change the orderBy:'code' when column is clicked, assume that the user clicked on the column location, i want the orderBy condition to change to 'location' instead of code, and to be in this form