create a hover-tooltip which can be clicked in angularjs

akashrajkn picture akashrajkn · Jun 3, 2015 · Viewed 7.4k times · Source

I am trying to create a hover-tooltip using Bootstrap UI. The tooltip should be visible when mouse is hovered on the button, the tooltip has a link which should be clickable. But the default popover and tooltip provided by Bootstrap UI, disappear when mouse comes out of it. I have searched a lot online, but couldn't find a solution. Some sites have given a solution using jQuery, but my requirement is in AngularJS. Many sites cite that we have to use $tooltipProvider, could you please tell me how to write a customEvent for 'mouseenter' and 'mouseleave' inside the controller.

Answer

Ritesh Kashyap picture Ritesh Kashyap · Jun 3, 2015

Are you looking for popover tooltip which is being stable and hide once it is accessed...Please see below working fiddle:

FIDDLE

<i class="fa fa-info-circle infoIcon" data-toggle="popover" data-content='Lorem Ipsum<br/><a href="#"><span class="learnMore">Learn More</span></a>'></i>

JS:

<i class="fa fa-info-circle infoIcon" data-toggle="popover" data-content='Lorem Ipsum<br/><a href="#"><span class="learnMore">Learn More</span></a>'></i>