【发布时间】:2019-12-27 21:37:07
【问题描述】:
我正在使用 ngx-bootstrap 中的工具提示,并希望将数据传递给工具提示的 ng-template。该文档提供了 [tooltipContext],但它似乎没有工作。我提供了一个代码 sn-p。
HTML:
<ng-template #tooltipTmpl let-view="view">
<div class="tooltip-section">
<div class="section-title">
{{ view.dateRangeText }}
</div>
<div class="section-text">
{{ view.data }}
</div>
</div>
</ng-template>
<div
*ngIf="view.isVisible"
[tooltip]="tooltipTmpl"
[tooltipContext]="{view: view}"
containerClass="white-tool-tip"
placement="top"
>
<div class="sub-title">
{{ view.title }}
</div>
</div>
【问题讨论】:
-
工具提示是纯文本而不是 HTML。使用 popover 并给它一个自定义类,让它看起来像你想用工具提示实现的任何东西。
标签: javascript html angular tooltip ngx-bootstrap