带有html的ngbPopover [英] ngbPopover with html inside

查看:116
本文介绍了带有html的ngbPopover的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将html放入ngbPopover?确实,我需要列出项目清单. 目前,我有以下参数:

Is it possible to put html inside ngbPopover? Exactly, I need to put list of items. Currently I have this parameters:

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

推荐答案

是的,但是您需要像这样使用<ng-template>元素:

Yes, but you need to use <ng-template> element like so:

<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=预览

Here is a working plunker: http://plnkr.co/edit/re1JbPmiF11Qm3Pf3BtW?p=preview

这也记录在演示页面上: https://ng-bootstrap .github.io/#/components/popover/examples

This is also documented on out demo page: https://ng-bootstrap.github.io/#/components/popover/examples

这篇关于带有html的ngbPopover的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆