如何将 html 添加到 Angular4 中的弹出窗口
How to add html to a popover in Angular4
我使用 ngx-popover 中的 PopoverModule 在 angular 中成功制作了悬停弹出窗口,它是这样工作的:
<a popover="hello" [popoverOnHover]="true"> popover</a>
现在我需要将 "hello" 更改为 html(添加图像,div ...)
我做了一些研究,发现了这个例子
<ng-template #popContent>Hello, <b>{{name}}</b>!</ng-template>
<button type="button" class="btn btn-outline-secondary"
[ngbPopover]="popContent" popoverTitle="Fancy content">
I've got markup and bindings in my popover!
</button>
但是没用!有任何想法吗?
你的
<a popover="hello" [popoverOnHover]="true"> popover</a>
需要匹配#popContent 名称。
其次,你的内容有点乱。您需要查看文档 here。尝试更多类似的东西。另外,了解 HTML...您有未关闭的标签和属于您的 popover 属性。
我的弹出窗口中有标记和绑定!
我使用 ngx-popover 中的 PopoverModule 在 angular 中成功制作了悬停弹出窗口,它是这样工作的:
<a popover="hello" [popoverOnHover]="true"> popover</a>
现在我需要将 "hello" 更改为 html(添加图像,div ...) 我做了一些研究,发现了这个例子
<ng-template #popContent>Hello, <b>{{name}}</b>!</ng-template>
<button type="button" class="btn btn-outline-secondary"
[ngbPopover]="popContent" popoverTitle="Fancy content">
I've got markup and bindings in my popover!
</button>
但是没用!有任何想法吗?
你的
<a popover="hello" [popoverOnHover]="true"> popover</a>
需要匹配#popContent 名称。
其次,你的内容有点乱。您需要查看文档 here。尝试更多类似的东西。另外,了解 HTML...您有未关闭的标签和属于您的 popover 属性。
我的弹出窗口中有标记和绑定!