Search code examples
angulartwitter-bootstrappopoverng-bootstrap

ng-bootstrap popover inside <a> tag


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

but instead of a button it's a link.

Many thanks!


Solution

  • Use same way under a tag like below

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

    Working demo https://stackblitz.com/edit/angular-jewqs1