I'm using this Rating Component, and what I need to achieve is the feature of setting its value to zero in case just one star is selected and the user clicks again on the first star (to deselect it).
The only events that are being fired are onHover and onLeave, but they contain not enough information to implement this feature.
Is there any other event that I can use in order to check this particular event:
In such a case the value should be set to zero, meaning that the first element should behave like a toggle button, between the value 0 and 1 of the Rating component.
You can listen to the click events on the rating component and keep track of the previous rating. Also on click events you can check whether the previous rating and new rating are both 1
and set the rating to 0
based on that.
Here's how I did it: https://stackblitz.com/edit/angular-jdsbue