我正在使用ngx-bootstrap中的工具提示,并希望将数据传递给工具提示的ng-template。该文档提供了[tooltipContext],但似乎没有用。我提供了一个代码段。
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>
我在项目中使用了引导程序popover
,因此建议使用弹出窗口。
[此外,在GitHub上创建了一个问题,但用户最终使用了popover-https://github.com/valor-software/ngx-bootstrap/issues/4775