Is it possible to animate the rotation of a chevron icon from left-facing to right-facing using Angular?
CSS:
.rotate-chevron {
transition: .1s linear;
}
HTML:
<button [class.button-open]="!slideOpen"
[class.button-close]="slideOpen"
(click)="changeSlide()">
<i class="rotate">{{slideOpen ? 'chevron_left' : 'chevron_right'}}</i>
</button>
TS:
changeSlide(): void {
this.slideOpen = !this.slideOpen;
}
Check out a live example on CodePen