Detect when uib-popover opens and closes?

I've been playing around with uib-popover and can't figure out how to detect when the popover is displayed or closed. It doesn't seem to have events like "shown .bs.open / hidden" that exist for a normal bootable popover.

Is there a way to do this I am lost?

The display of the popover itself is shown on click, but apparently at this point, it seems always not visible if it is open or closed. Notice what I am adding to the body.

THH

+3


source to share


1 answer


I think you are looking for a subdirectory popover-is-open

From the docs

popover-is-open (default: false) - whether to show the popover.

Note that this subdirectory uses an observer

This parameter has an angular $ watch prompt to it.



Here's how to use it

<button uib-popover="I am activated manually" 
        popover-is-open="isOpen2"
        type="button" class="btn btn-default">
  Toggle popover
</button>

      

And you can initialize it in your controller

$scope.isOpen2 = false; // or true

      

Here's a demo panel

0


source







All Articles