<a> tag

时间:2018-08-11 18:34:43

标签: angular twitter-bootstrap popover ng-bootstrap

My question is very simple, have a Angular 5 component to have a question link as follows:

<a href="">¿Do you have any problem?</a>

I want to add a popover over element (in the top position), so that when you click on it, show the popover and when you click again the popover will hide.

like that:

ng-bootstrap example

中的ng-bootstrap popover

但不是按钮,而是链接。

非常感谢!

2 个答案:

答案 0 :(得分:1)

在下面的标记下使用相同的方式

<a class="your-class" placement="top" ngbPopover="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." popoverTitle="Popover on top">
  Popover on top
</a>

工作演示 https://stackblitz.com/edit/angular-jewqs1

答案 1 :(得分:0)

您可以在下面的代码中找到这个

<a class="icon-info" [ngbTooltip]="HelpContent" #toolTip="ngbTooltip" (click)="toolTip.open()"></a>

<ng-template #HelpContent>
  Here is Help content
</ng-template>