Как переделать на ангуляр?
подсветка пункта меню при скролле
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
document.querySelectorAll('.main-header__points .main-header__col').forEach((link) => {
link.classList.toggle('main-header__col--active', link.getAttribute('href').replace('#', '') == entry.target.id)
})
}
})
}, {
threshold: 0.5
})
document.querySelectorAll('.section').forEach(
(section) => observer.observe(section)
);