我正在使用 ng-table 在表网格视图中显示所有值。我想在用户将鼠标悬停在单元格上时显示一些消息。所以我使用 ng-attr-title 作为工具提示。它在 firfox 中工作,但在 google chrome 网络浏览器中不起作用。
Sample
Plunker http://plnkr.co/edit/OuDgwod8z8sItnzAL2Ix?p=preview
Thanks.
看来我们在其他问题中讨论过Here https://stackoverflow.com/questions/30568156/how-to-bind-title-attribute-value-in-ng-table/30568601#30568601。使用 Div 来解决这个问题。
我已经编辑了您的 HTML 块:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<script src="https://code.angularjs.org/1.2.9/angular.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.10.0/ui-bootstrap-tpls.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ng-table/0.3.3/ng-table.min.js"></script>
<script src="script.js"></script>
</head>
<body ng-app="myApp">
<table ng-table="tableParams" class="table" ng-controller="ctrl">
<tbody>
<tr ng-repeat="foo in data">
<td data-title="'Name'">{{foo.name}}</td>
<td data-title="'Age'">{{foo.age}}</td>
<td ng-attr-title="{{foo.Desc}}" data-title="'Remarks'" >
<div ng-attr-title="{{foo.Desc}}">{{foo.Desc | limitTo: 15 }} {{foo.Desc.length > 15 ? '...' : ''}}</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>
带脚本的完整代码请参阅此PLUNKER http://plnkr.co/edit/OuDgwod8z8sItnzAL2Ix?p=preview
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)