My goal is to activate the function setHighlight
when a li
element is hovered over with a mouse. The ng-mouseover
event is employed within an ng-repeat
loop.
The problem arises when hovering over a li
element: the ng-mouseover
event gets triggered multiple times, equivalent to the number of iterations. Below is a snippet of my code:
<ul>
<li ng-repeat="review in foodReviews" ng-mouseover="setHighlight(review.id)">
<h4>{{review.name}}</h4>
<b>{{review.stars}} Stars</b>
<i> -- {{review.location}} </i><br />
<blockquote> {{review.description}} </blockquote>
<br/> written by {{review.author}}
</li>
</ul>
Could it be that I have placed the hover event in the wrong location?