DEV Community

Nagarajan R
Nagarajan R

Posted on

Answer: How to use bootstrap scrollspy on angular 7 project?

check the solution here using a directive for spyScroll. It listens to scroll event on the page and highlights the current section in view.

import { Directive, Injectable, Input, EventEmitter, Output, ElementRef, HostListener } from '@angular/core';

@Directive({
    selector: '[scrollSpy]'
})
export class ScrollSpyDirective {
    @Input() public spiedTags = [];

Top comments (0)