Skip to content

Commit c69c699

Browse files
committed
Added track by to optmize ng-repeat
- Added attr-id to facilitate testing e2e
1 parent 0c1bf95 commit c69c699

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/paging.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,16 @@ angular.module('bw.paging', []).directive('paging', function () {
9494
'<li ' +
9595
'title="{{Item.title}}" ' +
9696
'data-ng-class="Item.liClass" ' +
97-
'data-ng-repeat="Item in List"> ' +
98-
'<a ' +
97+
'data-ng-repeat="Item in List track by $index"> ' +
98+
'<a ' +
9999
(attrs.pgHref ? 'data-ng-href="{{Item.pgHref}}" ' : 'href ') +
100100
'data-ng-class="Item.aClass" ' +
101101
'data-ng-click="Item.action()" ' +
102-
'data-ng-bind="Item.value">'+
102+
'data-ng-bind="Item.value">'+
103+
'ng-attr-id="$first || $last ? $index : undefined"'
103104
'</a> ' +
104105
'</li>' +
105-
'</ul>'
106+
'</ul>'
106107
}
107108

108109

0 commit comments

Comments
 (0)