我无法禁用点击uib-accordion标题,只有当我点击右边的箭头时才打开它。
标题上还有一个按钮,点击文字Show button but don't open accordion
时会显示该按钮,也不应该点击按钮手风琴按钮。
我试过给css style =" pointer-events:none"但此功能禁用整个标题范围。
<div style="pointer-events:none">
<span ng-click="showButton=!showButton">Show button but don't open accordion</span>
<button ng-if="showButton" type="button">Click</button>
</div>
Plunker链接here
答案 0 :(得分:3)
使用函数调用preventDefault和stopPropagation。
$scope.toggleButton = function($event){
$event.stopPropagation();
$event.preventDefault();
$scope.showButton=!$scope.showButton;
};