Bind only visible data to html using viewport.
Live Demo
npm install angular-virtual-repeat
The vm.matrix is a matrix (an array with arrays).
The directive generates table element by calculating the viewport named ng-virtual-repeat-container.
The cell-height and cell-width attributes are optional.
angular.module('app', [
'ngVirtualRepeat'
]);vm.matrix = [
["0, 0", "0, 1", "0, 2" ...]
["1, 0", "1, 1", "1, 2" ...]
["2, 0", "2, 1", "2, 2" ...]
...
];<div class="ng-virtual-repeat-container">
<div>
<table>
<tbody ng-virtual-repeat="vm.matrix" [watch-size="true"]>
</tbody>
</table>
</div>
</div>ng-virtual-repeat-container: the class of the parent div to serve as a viewport default css: overflow: scroll, width: 100%, height: 600pxng-virtual-repeat: matrix object, the directive itselfwatch-size: bool, default: false, watch for viewport resize if source data are immutable
Live Demo or clone and run.
npm install
bower install
npm start
gulp build
This implementation lack of posibility to add header in the table.
But a common solution is to add headers in separate div and simply sync with scroll events if needed.
You are wellcome to add additional feature and make pull request 😄