gj-batched-repeatable
v1.0.2
Published
Small AngularJS library for easy batching of ng-repeat renders.
Downloads
2
Readme
gj-batched-repeatable
Small AngularJS library for easy batching of ng-repeat renders.
Notes:
- This project is currently under development and is not recommended for production use.
- Public API has potential to change.
Usage
Import into your application
import 'gj-batched-repeatable';
angular.module('your.module', ['gj-batched-repeatable'])
Create a BatchedRepeatable from your collection
import { BatchedRepeatable, BatchedRepeatableFactory } from 'gj-batched-repeatable';
export class MyController {
public static $inject = ['$batchedRepeatableFactory'];
public collection: BatchedRepeatable<T>
constructor(private $batchedRepeatableFactory: BatchedRepeatableFactory) {
this.collection = $$batchedRepeatableFactory.create([/*large collection*/], /* Batch Size */ 10);
}
}
Use batched version in your ng-repeat
<ul>
<li ng-repeat="item in $ctrl.collection.batched track by $index"><li>
</ul>