I am trying to display the large set of records with ng-repeat, but the browser crashes.How could I display large dataset without using infinite scroll.
2 Answers
Like the others suggest, 6000 rows begs to be paged, but technically angular can handle that. I created a codepen with angular generating 10k rows are using ng-repeat to display a table, to show its technically possible. I suggest you use track-by in your ng-repeat as well as ng-cloak to optimize the rendering of that much data.
<tbody ng-cloak>
<tr ng-repeat="item in items track by item.key">
The reason your browser is crashing is likely due to the way the data is being created (possibly adding each row to the cope at a time and causing many render cycles), or due to the complexity of each rows display. So optimizations could allow you to display that much data without the browser crashing, but its still not a good idea (or a good user experience).
Comments
6000 records is a problem that begs for paging in some form. Loading 6000 records in one go is not a good solution and especially not considering you are using Angular. You should use an Angular construct such as a dataTable which supports paging.
6000records at a time as user is not going to view6000record at time, I'd say that either do pagination or useinfinite scroll..