angularjs – Angular UI-Select:如何为文本溢出添加工具提示?

前端之家收集整理的这篇文章主要介绍了angularjs – Angular UI-Select:如何为文本溢出添加工具提示?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个ui-select-match元素,当打开元素并在一行上悬停(突出显示)时,我需要一个工具提示,以便在文本溢出被边框切断的情况下显示该行的完整内容.

这似乎应该是ui-select的一个特性,但我找不到任何关于这样的东西的参考.到目前为止,我只找到了显示行内整个文本的解决方案.

谢谢!

解决方法

把title =“{{selected.name}}”放在持有ui-select-match指令的元素上怎么样?但是,工具提示无论如何都会在文本溢出时出现.

码:

<ui-select ng-model="address.selected"
             theme="bootstrap"
             ng-disabled="disabled"
             reset-search-input="false"
             style="width: 300px;">
    <ui-select-match title="{{address.selected.formatted_address}}" placeholder="Enter an address...">{{$select.selected.formatted_address}}</ui-select-match>
    <ui-select-choices repeat="address in addresses track by $index"
             refresh="refreshAddresses($select.search)"
             refresh-delay="0">
      <div ng-bind-html="address.formatted_address | highlight: $select.search"></div>
    </ui-select-choices>
</ui-select>

plnkr

猜你在找的Angularjs相关文章