Skip to content

Commit 01a43f4

Browse files
Merge pull request michaelbromley#280 from rossholdway/object-pagination-fix
Fix pagination when using an object with dir-paginate
2 parents 853a5c0 + c7de7b0 commit 01a43f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/directives/pagination/dirPagination.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
return collectionGetter(scope);
9494
}, function(collection) {
9595
if (collection) {
96-
paginationService.setCollectionLength(paginationId, collection.length);
96+
var collectionLength = (collection instanceof Array) ? collection.length : Object.keys(collection).length;
97+
paginationService.setCollectionLength(paginationId, collectionLength);
9798
}
9899
});
99100
}

0 commit comments

Comments
 (0)