IntersectionObserverService

Wraps the IntersectionObserver API with an Observable-based interface. Detects when elements enter or leave the viewport with configurable thresholds and root margins.

API Variant
TypeScriptexample.ts
import { IntersectionObserverService } from '@angular-helpers/browser-web-apis'

# Methods

MethodSignatureReturnsDescription
observeobserve(element: Element, options: IntersectionObserverOptions): Observable<IntersectionObserverEntry[]>Observable<IntersectionObserverEntry[]>Public method observe.
observeVisibilityobserveVisibility(element: Element, options: IntersectionObserverOptions): Observable<boolean>Observable<boolean>Public method observeVisibility.
LCP N/A
CLS N/A
INP N/A