0

I want to inject ng-dbclick if just a condition is true :

<li ng-if="condition ? ng-dblclick='event()':nothing">

Thanks.

Feras Al Sous
  • 1,073
  • 1
  • 12
  • 23
  • 1
    Another solution could be to check the condition insde the onclick call. Something like
  • or just implement the if inside the event method event(){if(condition){...}} – Leonardo Neninger Aug 16 '18 at 14:28
  • ok thanks but i will try – Abdelmajid Bahmed Aug 16 '18 at 14:32
  • Possible duplicate of [AngularJS Disable ngClick](https://stackoverflow.com/questions/51845858/angularjs-disable-ngclick/51846416#51846416) – georgeawg Aug 16 '18 at 15:18
  • @LeonardoNeninger You should add that as an answer. Then you will get points when people upvote it. I like solutions that remove the clutter from the HTML. – georgeawg Aug 16 '18 at 15:43