Search code examples
angularjsanchorpopoverangular-strap

AngularStrap popover on anchor


I want to use AngularStrap Popover to trigger a popover from a text element. Is it possible to trigger a popover from an anchor? Or a span element or such?

This works:

<button content="hello" trigger="focus" bs-popover>clickme</button>

But this doesn't:

<a href="" content="hello" trigger="focus" bs-popover>clickme</a>
<span href="" content="hello" trigger="focus" bs-popover>clickme</span>
<label href="" content="hello" trigger="focus" bs-popover>clickme</label>
<small href="" content="hello" trigger="focus" bs-popover>clickme</small>

I can't find an example of how to do it was an anchor - and neither whether it is possible or not. (span element any other lablelike element would also go, but no button .....) Seems like a quite stupid question to me, but I really couldn't find an proper answer :/

Thanks very much!


Solution

  • The problem is that trigger='focus' works for focusable elements; button is focusable, anchors and spans are not. Try trigger='hover', or trigger='click' You can check my plunker: http://plnkr.co/edit/4oi1ucgQa6zqhQSlVhzu