带有 html 的 ngbPopover
ngbPopover with html inside
是否可以将 html 放入 ngbPopover 中?确切地说,我需要列出项目。
目前我有这个参数:
`ngbPopover="{{column.popup.get(row)}}" triggers="mouseenter:mouseleave" popoverTitle="{{column.popup.title | translate}}" container="body"`
是的,但是您需要像这样使用 <ng-template>
元素:
<ng-template #popContent>Hello, <b>{{name}}</b>!</ng-template>
<button type="button" class="btn btn-secondary" [ngbPopover]="popContent" popoverTitle="Fancy content">
I've got markup and bindings in my popover!
</button>
这是一个正在工作的插件:http://plnkr.co/edit/re1JbPmiF11Qm3Pf3BtW?p=preview
这也记录在演示页面上:https://ng-bootstrap.github.io/#/components/popover/examples
是否可以将 html 放入 ngbPopover 中?确切地说,我需要列出项目。 目前我有这个参数:
`ngbPopover="{{column.popup.get(row)}}" triggers="mouseenter:mouseleave" popoverTitle="{{column.popup.title | translate}}" container="body"`
是的,但是您需要像这样使用 <ng-template>
元素:
<ng-template #popContent>Hello, <b>{{name}}</b>!</ng-template>
<button type="button" class="btn btn-secondary" [ngbPopover]="popContent" popoverTitle="Fancy content">
I've got markup and bindings in my popover!
</button>
这是一个正在工作的插件:http://plnkr.co/edit/re1JbPmiF11Qm3Pf3BtW?p=preview
这也记录在演示页面上:https://ng-bootstrap.github.io/#/components/popover/examples