
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
ng-intersection
Advanced tools
Angular library that wraps the browser IntersectionObserver in an Angular directive
Angular library that wraps the browser IntersectionObserver in an Angular directive. The library allows for getting a callback whenever the target element enters/exits the ancestor/viewport depending on the options. Allows for browser based in viewport detection instead of old style Element.getBoundClientRect().
Useful for many different scenarios such as:
The library has no external dependencies.
Install using npm or yarn.
npm i ng-intersection
Add the Angular directive to the element you want to get notified about.
<div libNgIntersection (intersectionChanged)="intersectionChanged($event)" [intersectionObserverInit]="options" [waitBeforeReportingIntersection]="700"></div>
intersectionChanged will be triggered when the element enters/exits the ancestor/viewport.
waitBeforeReportingIntersection is an optional parameter that allows for only getting visible events if the element remains in the viewport for x amount of time. Useful for only loading/rendering elements if the user waits x amount of ms before scrolling past it.
intersectionObserverInit allows for specifying what options should be used for the IntersectionObserver. If no options are specified it will use the viewport by default for intersection detection.
Targeting a specific element with IntersectionObserver options:
const options = { root: xyzHtmlElement, rootMargin: '0px', threshold: 1.0 }
See: https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver for docs on the options.
#Browser compatibility See: https://caniuse.com/#feat=intersectionobserver
FAQs
Angular library that wraps the browser IntersectionObserver in an Angular directive
We found that ng-intersection 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.