@thejlifex/ngx-scroll-spy
Version:
An Angular library that can spy the position of elements (inside a scrollable container) and emit the currently active (visible) element in the viewport.
36 lines (35 loc) • 1.35 kB
TypeScript
import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { ScrollSpyService } from './scroll-spy.service';
import * as i0 from "@angular/core";
/**
* Spies on the spyTarget that has the provided `spyTargetId`.
*/
export declare class SpyDirective implements OnInit, OnDestroy {
private scrollSpyService;
private platformId;
private changeDetectorRef;
/**
* ID of the spyTarget to spy.
*/
spyTargetId: string;
/**
* @optional
*
* ID of the spyTargetContainer containing the spyTarget.
*/
spyTargetContainerId?: string;
/**
* Class name to add to this element when the spyTarget has transitioned into a state of intersection (is visisble).
*
* @default
* 'active'
*/
spyActiveClass: string;
activeClassInDOM?: string;
private directiveDestroyed$;
constructor(scrollSpyService: ScrollSpyService, platformId: string, changeDetectorRef: ChangeDetectorRef);
ngOnInit(): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<SpyDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<SpyDirective, "[spy]", never, { "spyTargetId": "spyTargetId"; "spyTargetContainerId": "spyTargetContainerId"; "spyActiveClass": "spyActiveClass"; }, {}, never, never, true>;
}