
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ng2-virtual-scroll
Advanced tools
Ng2VirtualScroll is a virtual scroll library with supporting row expansion.
Can be used with mat-table.
#Usage example ADD MODULE TO IMPORTS
import {Ng2VirtualScrollModule} from "ng2-virtual-scroll";
@NgModule({
declarations: [
],
imports: [
Ng2VirtualScrollModule
],
bootstrap: []
})
export class AppModule { }
HTML
<ng2-virtual-scroll
#virtualScroll
[totalRows]="100000"
[renderRows]="10"
[rowHeight]="88"
(renderer)="handleScrollChanges($event)"
>
<div *ngFor="let itemIndex of indexesArr; let i = index;">
<div [style.height.px]="88 + (expandedElementHeight && expandedElementIndex === itemIndex ? expandedElementHeight : 0)">
<div
(click)="rowClicked($event, itemIndex)">
{{items.all[itemIndex]}}
</div>
<div *ngIf="expandedElementHeight && expandedElementIndex === itemIndex" [style.height.px]="expandedElementHeight" [style.background-color]="'orange'">
</div>
</div>
</div>
</ng2-virtual-scroll>
TS
import {Component, ElementRef, ViewChild} from '@angular/core';
import {Ng2VirtualScrollComponent} from "ng2-virtual-scroll";
@Component({
selector: 'app-home-page',
templateUrl: './home-page.component.html',
styleUrl: './home-page.component.scss'
})
export class HomePageComponent {
@ViewChild('virtualScroll', {static: false}) virtualScroll?: Ng2VirtualScrollComponent;
items = {
all: Array.from(Array(100000).keys())
};
indexesArr: number[] = [];
handleScrollChanges(indexes: number[]) {
this.indexesArr = [...indexes];
}
rowClicked = ($event: Event, index: number, height: number = 1000) => {
this.virtualScroll?.rowClicked(index, height);
}
get expandedElementHeight(): number {
return this.virtualScroll?.expansion.height || 0;
}
get expandedElementIndex(): number | undefined {
return this.virtualScroll?.expansion.element?.index;
}
}
#Custom styles To change height of view port overwrite styles of".virtual-scroll-wrapped".
Custom Styles Example:
.virtual-scroll-wrapped {
height: 500px
}
#Bugs report, contact and support email: igor.gaiduk.dev@gmail.com
#Bugs fixes history: November 29, 2023 - Fixed scroll using scroll bar when one of the last 10 rows expanded.
FAQs
Virtual Scroll library with supporting row expansion.
The npm package ng2-virtual-scroll receives a total of 1 weekly downloads. As such, ng2-virtual-scroll popularity was classified as not popular.
We found that ng2-virtual-scroll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.