Created
March 17, 2015 05:56
-
-
Save wcc526/7b156dce6e2c44d9ba51 to your computer and use it in GitHub Desktop.
angular table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-init="customers=[{name:'abc',city:'defg'},{name:'def',city:'helo'}]"> | |
<input type="text" ng-model="customerFilter.name"/> | |
<table> | |
<tr> | |
<th ng-click="sortBy='name';reverse=!reverse">Name</th> | |
<th ng-click="sortBy='city';reverse=!reverse">City</th> | |
</tr> | |
<tr ng-repeat="cust in customers | filter:customerFilter.name | orderBy:sortBy:reverse" > | |
<td>[[ cust.name | uppercase ]]</td> | |
<td>[[ cust.city | uppercase ]]</td> | |
</tr> | |
</table> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment