【问题标题】:ngbPopover with html insidengbPopover 里面有 html
【发布时间】:2017-07-25 20:52:01
【问题描述】:

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

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

【问题讨论】:

    标签: angular ng-bootstrap


    【解决方案1】:

    是的,但你需要像这样使用<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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多