@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.
30 lines (29 loc) • 1.18 kB
TypeScript
import { ElementRef, OnInit, OnDestroy } from '@angular/core';
import { ScrollSpyService } from './scroll-spy.service';
import * as i0 from "@angular/core";
/**
* Adds this element as spy-target and starts to observe this target.
*
* Automatically removes this element as spy-target and stops observing this target when the element is destroyed.
*/
export declare class SpyTargetDirective implements OnInit, OnDestroy {
private elementRef;
private scrollSpyService;
private platformId;
/**
* ID for this spyTarget.
*/
spyTargetId: string;
/**
* @optional
*
* ID for the spyTargetContainer containing this spyTarget.
*/
spyTargetContainerId?: string;
private target;
constructor(elementRef: ElementRef<Element>, scrollSpyService: ScrollSpyService, platformId: string);
ngOnInit(): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<SpyTargetDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<SpyTargetDirective, "[spyTarget]", never, { "spyTargetId": "spyTargetId"; "spyTargetContainerId": "spyTargetContainerId"; }, {}, never, never, true>;
}