根据 Angularjs 中的条件禁用图标

Disable an icon based on condition in Angularjs

我在 td 中有一个图标,我想根据条件禁用它:

<td colspan="2" style="text-align: center;"><span 
                                            ng-disabled="action.isActionInprogress"
                                            ng-click="showAction($event,action)"
                                            style="cursor: pointer;" class="glyphicon glyphicon-eye-open"                                           
                                            title="{{action.isActionInProgress ? 'Cannot View While Action In Progress' : 'Show Action'}}">

它显示标题(操作进行中无法查看)但图标没有被禁用。 我错过了什么?

用按钮包裹 span 并尝试。我认为您不能直接为 span 应用 ng-disable。否则你必须动态应用样式并防止点击事件使跨度禁用

<button class="btn"  ng-disabled="action.isActionInprogress"  ng-click="showAction($event,action)"><span class="glyphicon glyphicon-eye-open" ></span></button>

Use CSS to make a span not clickable