All Projects → drawcall → Angular Infinite List

drawcall / Angular Infinite List

A short and powerful infinite scroll list library for angular, with zero dependencies

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Angular Infinite List

angular-rollbar-source-maps
Angular 2+ implementation to upload sourcemaps to Rollbar
Stars: ✭ 17 (-77.92%)
Mutual labels:  angular5, angular6
ngx-img
No description or website provided.
Stars: ✭ 25 (-67.53%)
Mutual labels:  angular5, angular6
ngx-image-editor
Awesome image editor for Angular 6
Stars: ✭ 74 (-3.9%)
Mutual labels:  angular5, angular6
ng-pdf-highlighter
PDF annotation with angular7
Stars: ✭ 15 (-80.52%)
Mutual labels:  angular5, angular6
Ngx Monaco Editor
Monaco Editor component for Angular 2 and Above
Stars: ✭ 347 (+350.65%)
Mutual labels:  angular5, angular6
ngx-print
🖨️ A plug n' play Angular (2++) library to print your stuff
Stars: ✭ 124 (+61.04%)
Mutual labels:  angular5, angular6
angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (-66.23%)
Mutual labels:  angular5, angular6
angularx-qrcode-sample-app
Angular5/6/7/8/9/10+ sample apps with working implementations of angularx-qrcode
Stars: ✭ 15 (-80.52%)
Mutual labels:  angular5, angular6
Ng Http Loader
🍡 Smart angular HTTP interceptor - Intercepts automagically HTTP requests and shows a spinkit spinner / loader / progress bar
Stars: ✭ 327 (+324.68%)
Mutual labels:  angular5, angular6
Angularx Qrcode
Angular4/5/6/7/8/9/10/11 QRCode generator component library for QR Codes (Quick Response) with AOT support based on node-qrcode
Stars: ✭ 281 (+264.94%)
Mutual labels:  angular5, angular6
ng-toggle
Bootstrap-styled Angular Toggle Component
Stars: ✭ 14 (-81.82%)
Mutual labels:  angular5, angular6
Angular Froala Wysiwyg
Angular 4, 5, 6, 7, 8 and 9 plugin for Froala WYSIWYG HTML Rich Text Editor.
Stars: ✭ 696 (+803.9%)
Mutual labels:  angular5, angular6
spring-websocket-angular6
Example for using Spring Websocket and Angular with Stomp Messaging
Stars: ✭ 18 (-76.62%)
Mutual labels:  angular5, angular6
ngx-konami
A simple directive to add easter eggs in your Angular application 👾
Stars: ✭ 34 (-55.84%)
Mutual labels:  angular5, angular6
Angular-Reactive-Demo-Shop
Angular Demo Shop
Stars: ✭ 79 (+2.6%)
Mutual labels:  angular5, angular6
mean-stack
MEAN stack Mongoose, Express, Angular6, Node
Stars: ✭ 22 (-71.43%)
Mutual labels:  angular5, angular6
file-input-accessor
Angular directive that provides file input functionality in Angular forms.
Stars: ✭ 32 (-58.44%)
Mutual labels:  angular5, angular6
ngx-loading-mask
Angular 5+ simple loading-mask ui component.
Stars: ✭ 22 (-71.43%)
Mutual labels:  angular5, angular6
Ngx Smart Modal
Modal/Dialog component crafted for Angular
Stars: ✭ 256 (+232.47%)
Mutual labels:  angular5, angular6
Angular Material App
基于最新Angular 9框架与Material 2技术的web中后台前端应用框架。
Stars: ✭ 509 (+561.04%)
Mutual labels:  angular5, angular6

A short and powerful infinite scroll list library for angular, with zero dependencies 💪

  • Tiny & dependency free – Only 3kb gzipped
  • Render millions of items, without breaking a sweat
  • Scroll to index or set the initial scroll offset
  • Supports fixed or variable heights/widths
  • Vertical or Horizontal lists

This library is transplanted from react-tiny-virtual-list and react-virtualized.

Check out the demo for some examples.

Getting Started

Using npm:

npm install angular-infinite-list --save

Import angular Infinite list module into your app module

import { InfiniteListModule } from 'angular-infinite-list';

@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    InfiniteListModule,
    ...

Wrap Infinite list tag around list items

<infinitelist
    style="width:100%"
    [width]='"100%"' 
    [height]='500' 
    [data]='data' 
    [itemSize]='50' 
    (update)='event = $event'>
        <div *ngFor="let item of event?.items; let i=index;" [ngStyle]="event.getStyle(i)">
            item{{event.start + i}} : {{item|json}}
        </div>
</infinitelist>

or directive usage
<div infinitelist [width]='"100%"' ...</div>

Higher performance usage

Because in the angular all the asynchronous operation will cause change detection.High-frequency operations such as the scroll event can cause significant performance losses.

So in some high-precision scenes, we can use rxjs Observable to solve. About angular asynchronous, change detection checks and zone.js. You can view zone.js and change detection

set @Input [useob]='true' and use ChangeDetectorRef

You can switch to the Observable mode. of course, if your scene on the efficiency requirements are not high can not do so.

demo.component.html
<infinitelist
    [width]='"100%"' 
    [height]='500' 
    [data]='data' 
    [itemSize]='150' 
    [useob]='true'
    (update)='update($event)'>
        <div class="li-con" *ngFor="let item of event?.items; let i=index;" [ngStyle]="event.getStyle(i)">
            item{{event.start + i}}
        </div>
</infinitelist>
demo.component.ts

Notice! useob mode update trigger once and otherwise it will trigger multiple times

event: ILEvent;
constructor(private cdRef: ChangeDetectorRef) { }
  
//Notice! useob mode update trigger once and otherwise it will trigger multiple times
update($event: Subject<any>) {
    $event.subscribe(x => {
		this.event = x;
      	this.cdRef.detectChanges();
	});
}

view demo code

Prop Types

Property Type Required? Description
width Number or String* Width of List. This property will determine the number of rendered items when scrollDirection is 'horizontal'.
height Number or String* Height of List. This property will determine the number of rendered items when scrollDirection is 'vertical'.
data any[] The data that builds the templates within the Infinite scroll.
itemSize Either a fixed height/width (depending on the scrollDirection), an array containing the heights of all the items in your list, or a function that returns the height of an item given its index: (index: number): number
scrollDirection String Whether the list should scroll vertically or horizontally. One of 'vertical' (default) or 'horizontal'.
scrollOffset Number Can be used to control the scroll offset; Also useful for setting an initial scroll offset
scrollToIndex Number Item index to scroll to (by forcefully scrolling if necessary)
scrollToAlignment String Used in combination with scrollToIndex, this prop controls the alignment of the scrolled to item. One of: 'start', 'center', 'end' or 'auto'. Use 'start' to always align items to the top of the container and 'end' to align them bottom. Use 'center' to align them in the middle of the container. 'auto' scrolls the least amount possible to ensure that the specified scrollToIndex item is fully visible.
overscanCount Number Number of extra buffer items to render above/below the visible items. Tweaking this can help reduce scroll flickering on certain browsers/devices.
estimatedItemSize Number Used to estimate the total size of the list before all of its items have actually been measured. The estimated total height is progressively adjusted as items are rendered.
update Output This event is fired every time when dom scroll. The event sent by the parameter is a ILEvent object.

* Width may only be a string when scrollDirection is 'vertical'. Similarly, Height may only be a string if scrollDirection is 'horizontal'

The IILEvent interface

export interface IILEvent {
    items: any[],
    offset: number,
    getStyle(index: number): any,
    data?: any[],
    start?: number,
    stop?: number
}

Reporting Issues

Found an issue? Please report it along with any relevant details to reproduce it.

Acknowledgments

This library is transplanted from react-tiny-virtual-list and react-virtualized. Thanks for the great works of author Claudéric Demers ❤️

License

is available under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].