Accessing sibling scopes
Access with $$prevSibling
and $$nextSibling
properties of your scopes.
Playing with an integer
Instead of having to access siblings scopes, manipulate an integer so that ng-class
directive would become something like that:
ng-class="{ rtHover: 3 < myInteger }"
Then your hoveredStar
would just have to set that integer.
Performance concern
Such a rate component, if used intensively in a same page, should not be an angular component since it generates a lot of digestions from the root scope.