Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular2-virtual-scroll

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-virtual-scroll - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

angular2-virtual-scroll-0.2.0.tgz

5

CHANGELOG.md
# v0.2.1
* Added ability to get viewPortItems as a field instead of event
* Added easier ability of using window scrollbar
# v0.2.0

@@ -3,0 +8,0 @@

4

dist/virtual-scroll.d.ts

@@ -15,5 +15,6 @@ import { ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';

private refreshHandler;
_parentScroll: Element | Window;
private _parentScroll;
parentScroll: Element | Window;
update: EventEmitter<any[]>;
viewPortItems: any[];
change: EventEmitter<ChangeEvent>;

@@ -29,2 +30,3 @@ start: EventEmitter<ChangeEvent>;

startupLoop: boolean;
window: Window;
constructor(element: ElementRef);

@@ -31,0 +33,0 @@ onScroll(): void;

@@ -18,2 +18,3 @@ "use strict";

this.startupLoop = true;
this.window = window;
}

@@ -172,3 +173,4 @@ Object.defineProperty(VirtualScrollComponent.prototype, "parentScroll", {

// update the scroll list
this.update.emit(items.slice(start, end));
this.viewPortItems = items.slice(start, end);
this.update.emit(this.viewPortItems);
// emit 'start' event

@@ -175,0 +177,0 @@ if (start !== this.previousStart && this.startupLoop === false) {

{
"name": "angular2-virtual-scroll",
"version": "0.2.0",
"version": "0.2.1",
"description": "Angular 2 module for virtual -infinite- list. Supports multi-column",

@@ -5,0 +5,0 @@ "main": "dist/virtual-scroll.js",

@@ -39,2 +39,13 @@

```html
<virtual-scroll #scroll [items]="items">
<list-item *ngFor="let item of scroll.viewPortItems" [item]="item">
</list-item>
</virtual-scroll>
```
alternatively
```html
<div virtualScroll [items]="items" (update)="viewPortItems = $event">

@@ -144,2 +155,16 @@

## Getting view port items without events
If you are using AOT compilation (hope you do it) then in classic usage (with listening to `update` event) it is required to create field `viewPortItems` in your component.
There is a way how to avoid it.
```html
<virtual-scroll #scroll [items]="items">
<list-item *ngFor="let item of scroll.viewPortItems" [item]="item">
</list-item>
</virtual-scroll>
```
## Additional elements in scroll

@@ -183,8 +208,9 @@

```html
<virtual-scroll [items]="items"
[parentScroll]="window"
(update)="viewPortItems = $event">
<virtual-scroll
#scroll
[items]="items"
[parentScroll]="scroll.window">
<input type="search">
<div #container>
<list-item *ngFor="let item of viewPortItems" [item]="item">
<list-item *ngFor="let item of scroll.viewPortItems" [item]="item">
</list-item>

@@ -195,10 +221,2 @@ </div>

```ts
...
export class MyComponent {
...
window: window;
...
```
## Items with variable size

@@ -205,0 +223,0 @@

Sorry, the diff of this file is not supported yet

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