更改 ui.bootrap 的工具提示箭头的颜色(附有 plunker)

change color of tooltip arrow of ui.bootrap (plunker attached)

这是插件代码。 http://plnkr.co/edit/C1khFJqTUutDaK9ad7ud?p=preview

我需要更改工具提示箭头。示例中工具提示的位置是顶部、底部和左侧。

谁能告诉我如何设置这些工具提示的样式。我需要为工具提示的不同位置对工具提示箭头进行不同的着色。

例如

tooltip at top-> arrow color should be red
tooltip at bottom-> arrow color green
tooltip at left-> arrow color yellow

谁能告诉我如何获得这些 类 并将颜色应用于这些工具提示。

这是代码

HTML

<div ng-controller="TooltipDemoCtrl">
<br><br><br>
  <div ng-class="{'has-error' : !inputModel}">
    <input type="text" ng-model="inputModel" class="test"
      uib-tooltip="Tooltip TBD"
      tooltip-placement="top"
      tooltip-trigger="mouseenter"
      tooltip-enable="!inputModel" />
  </div>
</div>

CSS

.tooltip .tooltip-inner {
            color: white;
            background-color: blue;
            border-radius:5px;
}

.tooltip .tooltip-arrow { 
          //cant get the class for the arrow

}

试试这个,以顶部为例

.tooltip.top .tooltip-arrow {
    border-top-color: red!important;
}

正在更新关于 batas 的答案。这对我有用。

.tooltip.top .tooltip-arrow {
border-top-color: red!important;
}
.tooltip.bottom .tooltip-arrow {
border-bottom-color: green!important;
}
.tooltip.left .tooltip-arrow {
border-left-color: yellow!important;
}

你可以用tooltip-class我觉得比较方便
http://plnkr.co/edit/FVTuepTS7gXL3K2ixR8e?p=preview

html:

<div ng-controller="TooltipDemoCtrl">
<br><br><br>
  <div ng-class="{'has-error' : !inputModel}">
    <input type="text" ng-model="inputModel" class="test"
      uib-tooltip="Tooltip TBD"
      tooltip-class="tooltip-class"
      tooltip-trigger="mouseenter"
      tooltip-enable="!inputModel" />
  </div>
</div>

css

.tooltip-class .tooltip-arrow{
     border-top-color: red !important;
}