Check out this code snippet:
ngOnInit() {
const navSlide = () => {
const burger = document.querySelector('.burger');
const nav = document.querySelector('.nav-links');
const navLinks = document.querySelectorAll('.nav-links li');
burger.addEventListener('click', () => {
nav.classList.toggle('nav-active');
});
navLinks.forEach((link, index) => {
link.style.animation = `navLinkFade 0.5s ease forwards ${index / 7 + 0.3}s`;
});
};
navSlide();
}
The error message I'm encountering is:
Property 'style' does not exist on type 'Element'.ts(2339)
Any suggestions on how to resolve this issue?