Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
angular2-infinite-scroll
Advanced tools
Inspired by ng-infinite-scroll directive for angular (> 2).
Supports in Angular > +2, 4
I'm a Senior Javascript Engineer & A Front End Consultant at Orizens. My services include:
npm install angular2-infinite-scroll --save
Currently supported attributes:
By default, the directive listens to the window scroll event and invoked the callback.
To trigger the callback when the actual element is scrolled, these settings should be configured:
First, import the InfiniteScrollModule to your module:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { InfiniteScrollModule } from 'angular2-infinite-scroll';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppComponent } from './app';
@NgModule({
imports:[ BrowserModule, InfiniteScrollModule ],
declarations: [ AppComponent, ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule);
In this example, the onScroll callback will be invoked when the window is scrolled down:
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: `
<div class="search-results"
infinite-scroll
[infiniteScrollDistance]="2"
[infiniteScrollThrottle]="300"
(scrolled)="onScroll()">
</div>
`
})
export class AppComponent {
onScroll () {
console.log('scrolled!!')
}
}
in this example, whenever the "search-results" is scrolled, the callback will be invoked:
import { Component } from '@angular/core';
@Component({
selector: 'app',
styles: [
`.search-results {
height: 20rem;
overflow: scroll;
}`
],
template: `
<div class="search-results"
infinite-scroll
[infiniteScrollDistance]="2"
[infiniteScrollThrottle]="500"
(scrolled)="onScroll()"
[scrollWindow]="false">
</div>
`
})
export class AppComponent {
onScroll () {
console.log('scrolled!!')
}
}
In this example, the onScrollDown callback will be invoked when the window is scrolled down and the onScrollUp callback will be invoked when the window is scrolled up:
import { Component } from '@angular/core';
import { InfiniteScroll } from 'angular2-infinite-scroll';
@Component({
selector: 'app',
directives: [ InfiniteScroll ],
template: `
<div class="search-results"
infinite-scroll
[infiniteScrollDistance]="2"
[infiniteScrollUpDistance]="1.5"
[infiniteScrollThrottle]="500"
(scrolled)="onScrollDown()"
(scrolledUp)="onScrollUp()">
</div>
`
})
export class AppComponent {
onScrollDown () {
console.log('scrolled down!!')
}
onScrollUp () {
console.log('scrolled up!!')
}
}
FAQs
An infinite scroll directive for angular2
The npm package angular2-infinite-scroll receives a total of 704 weekly downloads. As such, angular2-infinite-scroll popularity was classified as not popular.
We found that angular2-infinite-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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.