如何使用AngularJS在禁用的按钮上启用Bootstrap工具提示? [英] How to enable Bootstrap Tooltip on disabled button using AngularJS?
本文介绍了如何使用AngularJS在禁用的按钮上启用Bootstrap工具提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在禁用的按钮上显示工具提示,如果使用AngularJS启用了工具提示,则将其删除.
I need to display a tooltip on a disabled button and remove it if it is enabled using AngularJS.
推荐答案
假设您正在使用angular-ui-bootstrap:
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>
这篇关于如何使用AngularJS在禁用的按钮上启用Bootstrap工具提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文