Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable Bootstrap Tooltip on disabled button using AngularJS?

I need to display a tooltip on a disabled button and remove it if it is enabled using AngularJS.

like image 751
Anurag Jaiswal Avatar asked Mar 24 '26 15:03

Anurag Jaiswal


1 Answers

Assuming you're using angular-ui-bootstrap:

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

<body ng-controller="MainCtrl" ng-app="plunker">
  <div style="height:100px"></div>
  <div uib-tooltip="asdsad" tooltip-enable="disableButton" style="display:inline-block">
    <button ng-disabled="disableButton" ng-style="{'pointer-events':disableButton ? 'none' : ''}">Hover over me!</button>
  </div>
  <br>Check the checkbox to disable the button <input type="checkbox" ng-model="disableButton">
</body>
like image 159
Fissio Avatar answered Mar 26 '26 04:03

Fissio