angular-tablesort icon indicating copy to clipboard operation
angular-tablesort copied to clipboard

tablesort does not allow ng-repeat alias_expression to be used

Open jamesdoherty opened this issue 10 years ago • 1 comments
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

jamesdoherty avatar Sep 08 '15 02:09 jamesdoherty

Solved it with use filteredItemsJs only inside the table and use track by item.Id like here : http://plnkr.co/edit/UrwPKBsYGqxAoELCQA2A?p=preview

psykolm22 avatar Feb 10 '16 16:02 psykolm22