【发布时间】:2020-03-10 18:43:42
【问题描述】:
我正在尝试将 ngbTooltip 放在 <table> 元素上
我已经在<th> 上遇到了问题,通过使用container 解决了这个问题,感谢post。
问题出现在<td> 元素上,该元素不显示任何工具提示,我在文档后找不到任何答案。
<tbody>
<ng-container *ngFor="let line of aggreg | sortByElement:filterField:ascending; let idx = index">
<tr *ngIf="showLine(line)">
<!-- tds without tooltips here -->
</tr>
<ng-container *ngIf="detailsSelected === idx && showLine(line)">
<tr *ngFor="let color of getColors(line) | sortByElement:'count':'false'" class="subline">
<!-- tds without tooltips here -->
<!-- Tooltip doesn't display when condition is true -->
<td ngbTooltip="foo" placement="left" *ngIf="conditionHere" class="..." (click)="redirect(line)">
<i class="fas fa-times"></i>
</td>
<!-- Tooltip doesn't display when condition is true -->
<td ngbTooltip="bar" placement="left" *ngIf="otherConditionHere" class="..." (click)="redirect(line)">
<i class="fas fa-check"></i>
</td>
<!-- Tooltip doesn't display when condition is true -->
<td ngbTooltip="baz" placement="left" *ngIf="anotherConditionHere" class="..." (click)="redirect(line)">
<i class="fas fa-camera"></i>
</td>
</tr>
</ng-container>
</ng-container>
</tbody>
同样添加container="body" 并不能解决<td>
【问题讨论】:
标签: html angular bootstrap-4 ng-bootstrap