New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngx-virtual-scroll-list

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-virtual-scroll-list

Angular Directive to add virtual scroll.

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

ngx-virtual-scroll-list

Angular Directive to add virtual scroll.

Live Demo : https://mraghuram3.github.io/#/ngx-virtual-scroll-list

Installation

To install this library, run:

$ npm install ngx-virtual-scroll-list --save

Usage

Import NgxVirtualScrollModule in the root module

import { NgxVirtualScrollModule } from 'ngx-virtual-scroll-list';

@NgModule({
  imports: [
    // ...
    NgxVirtualScrollModule.forRoot(),
    ...
  ]
})

In your template

<div ngxVirtualScroll [items]="data" [minRowHeight]="25" (change)="displayData = $event.data;actualIndex = $event.startIndex;" class="parent">
  <div ngxVirtualScrollElement [minRowHeight]="25" *ngFor="let r of displayData;let i = index;" [rangeStart]="actualIndex" [elemIndex]="i">{{r}}</div>
</div>
  • ngxVirtualScroll

    Add the directive to the div or other dom in which the elemnts are to be loaded

  • [items]: any[].

    The data which is populated on the virtual scroll list

  • [minRowHeight]: number.

    The minimum height of the row in pixels.

  • (change)="displayData = $event.data;actualIndex = $event.startIndex;":

    create two variables and update them with the events from change event as shown.

displayData = [];
actualIndex = 0;
.....
......
  • ngxVirtualScrollElement

    Add the directive to the div for row elements of the virtual scroll.

  • [minRowHeight]: number.

    The minimum height of the row in pixels.

  • [rangeStart]: number.

    Pass the data from change event.

    ** include other inputs in ngxVirtualScrollElement row, like ngFor and [elemIndex] **

    ** Specify height for the parent div in px, vh, em or rem (otherthan percentage) **

.parent{
    height:300px;
    width:300px;
}

License

MIT © Raghu Ram M

Keywords

FAQs

Package last updated on 24 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc