UNPKG

@q149/angular-scrollspy

Version:

A simple lightweight library for Angular which automatically updates links to indicate the currently active section in the viewport

58 lines (57 loc) 1.39 kB
import { ChangeDetectorRef } from '@angular/core'; /** * A directive used to add an `active` class to a nav item * when the section is in the viewport * * @example * ```html * <a snScrollSpyItem for="foo" href="#section1">Section 1</a> * ``` * */ export declare class ScrollSpyItemDirective { private cdRef; /** * True if the nav item is the active item in the `items` list * for `ScrollSpyDirective` instance * * @memberof ScrollSpyItemDirective */ active: boolean; /** * ID of `ScrollSpyDirective` instance * * @memberof ScrollSpyItemDirective */ for: string; /** * Hash for section to link to * * @memberof ScrollSpyItemDirective */ href: string; /** * If true means the section is in the viewport * * @memberof ScrollSpyItemDirective */ inViewport: boolean; /** * Id of section that links navigates to * * @readonly * @memberof ScrollSpyItemDirective */ readonly section: string; /** * Creates an instance of ScrollSpyItemDirective. * @memberof ScrollSpyItemDirective */ constructor(cdRef: ChangeDetectorRef); /** * Manually trigger change detection * * @memberof ScrollSpyItemDirective */ detectChanges(): void; }