I have four table headers:
$scope.headers = [\"Header1\", \"Header2\", \"Header3\", \"Header4\"];
And I want to be able to sort my table by
I'm just getting my feet wet with angular, but I found this great tutorial.
Here's a working plunk I put together with credit to Scott Allen and the above tutorial. Click search to display the sortable table.
For each column header you need to make it clickable - ng-click on a link will work. This will set the sortName of the column to sort.
Name
Then, in the table body you can pipe in that sortName in the orderBy filter orderBy:sortName:sortReverse
{{repo.name}}
{{repo.stargazers_count | number}}
{{repo.language}}