1.0.2 • Published 6 years ago
gj-batched-repeatable v1.0.2
gj-batched-repeatable
Small AngularJS library for easy batching of ng-repeat renders.
Notes: 1. This project is currently under development and is not recommended for production use. 2. 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>