add class css to ng-mouseenter in angularjs

0

I have a simple question it is possible to add a css class inside ng-mouseenter="myclass" that is when I pass the maouse by the image that a css class applies.

Greetings.

    
asked by Hernan Humaña 28.12.2016 в 01:35
source

1 answer

1

I leave you an example, it's super easy:

.red {
  background-color: red;
}

.italic {
  font-style: italic;
  color: black;
}
<div ng-app>
  <div 
    class="italic" 
    ng-class="{red: hover}" 
    ng-mouseenter="hover = true"
    ng-mouseleave="hover = false">
      Test 1 2 3.
  </div>
</div>

Greetings

    
answered by 28.12.2016 / 01:48
source