angular-tablesort
angular-tablesort copied to clipboard
tablesort does not allow ng-repeat alias_expression to be used
trafficstars
ng-repeat supports an alias_expression that can be used (for example) to find the length of a filtered object outside of ng-repeat. However when using tablesort, the alias_expression object is empty.
Example alias_expression usage:
<tr ng-repeat="item in items | filter:search as filteredItems">
<td>{{ item.id }}</td>
</tr>
<p>Number of items shown: {{ filteredItems.length || 0 }}
Example: http://plnkr.co/edit/zObDQ7YY1VEGBwdStWCT?p=preview
Solved it with use filteredItemsJs only inside the table and use track by item.Id like here : http://plnkr.co/edit/UrwPKBsYGqxAoELCQA2A?p=preview