Jhony  Blaze
Jhony Blaze

Reputation: 251

Angularjs - How to execute ng-mouseenter once

I have a problem, how to execute ng-mouseenter or ng-mousehover just once

http://plnkr.co/edit/CIdFhCJR8SOatjoDgd8m?p=preview

How to keep that "1" on count?

Upvotes: 1

Views: 227

Answers (1)

Kalhan.Toress
Kalhan.Toress

Reputation: 21901

use like this

<button ng-mouseover="(count == 0) ? count = count + 1 : return" ng-init="count=0">

IF count == 0 then execute the count = count + 1 ELSE just return.

DEMO PLUNKER

Upvotes: 4

Related Questions