So, I\'m just getting started with angularjs and I\'m already confused. I want to change the colour of a list element that corresponds to a hex code colour that is in an array.
See Plunker Demo Here
Use ng-style to conditionally apply CSS styles - I've chosen to name this style 'personStyle'
. Next, bind the ng-mouseover event to set the personStyle
background-color to the person's colour attribute. Finally, bind the ng-mouseleave event to reset the personStyle
when the mouse leaves the element. The changeColor() function is not needed for this solution to work.