I want to rotate element(clockwise on downscroll & anti-clockwise on upscroll) while scrolling the page. For that i use javascript code.But it's not working in angular.I just use the CDN links in index.html.Javascript code is not working in angular.Want to rotate starburst in top right corner
Html File:
<div class="starburst discount" id="star">
<span>17%</span>
</div>
My Javascript File is:
<script>
var star = document.getElementById("star");
window.addEventListener("scroll", function() {
star.style.transform = "rotate("+window.pageYOffset+"deg)";
</script>
Is there any other way to achieve the element rotate in Angular?Can anyone help with this?Thanks in Advance..