Angular UI Bootstrap Popover - How to close all open popover

I have a table with a popover for each cell, as in the following example:

call popover:

<td ng-repeat="i in c.installments" ng-class="{ 'first' : i.first, 'last' : i.last, 'advance' : i.advance.value > 0, 'edited' : i.edited, 'final-installment' : i.last }" popover-trigger="{{ popoverFilter(i) }}" popover-placement="top" popover-title="{{i.id == 0 ? 'Advance' : 'Installment ' + i.id}}" popover-append-to-body="true" popover-template="popoverTemplate(i)" ng-init="payment= i; newpayment= i.amount.rounded_value" > 

Popover template:

 <script type="text/ng-template" id="editPopoverTemplate.html"> <form name="editPayment"> <h2>{{payment.amount.value|currency:undefined:cents}}</h2> <div class="form-group" ng-class="{ 'has-error' : editPayment.newpayment.$invalid }"> <label>New value:</label> <input type="number" name="newpayment" ng-model="newpayment" class="form-control no-spinner" step="1" min="10" required> <span ng-messages="editPayment.newpayment.$error" class="help-block" role="alert"> <span ng-message="required">The value is mandatory</span> <span ng-message="min">The value is too low</span> <span ng-message="max">The value is too hight</span> </span> </div> <div class="btn-group btn-group-justified" role="group"> <div class="btn-group" role="group"> <button class="btn" type="button">Cancel</button> </div> <div class="btn-group" role="group"> <button class="btn btn-primary" type="button" ng-disabled="editPayment.$invalid">Save</button> </div> </div> </form> </script> 

working example for plunker

I need to close all open popover when a new popover is open. I need only open opening. Maybe? Do I need to extend the Angular UI Bootstrap library for this?

Any help is appreciated.

The solution suggested in the linked answer below allows you to open two popover, but I need to open only one popover, when the popover is open, the other (open) should be closed.

+6
source share
1 answer

Starting with version 0.13.4, we added the ability to programmatically open and close the tooltip and navigate through the tooltip-is-open or popover-is-open boolean property. Thanks to this, you can easily open and close tooltips and add on demand.

0
source

All Articles