ngbPopover里面有html

时间:2017-07-25 10:00:17

标签: angular ng-bootstrap

是否可以将html放入ngbPopover?确切地说,我需要列出项目清单。 目前我有这个参数:

`ngbPopover="{{column.popup.get(row)}}" triggers="mouseenter:mouseleave" popoverTitle="{{column.popup.title | translate}}" container="body"`

1 个答案:

答案 0 :(得分:9)

是的,但您需要使用<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

相关问题