Angular UI Bootstrap Popover - How add a close button

前端 未结 3 1865
陌清茗
陌清茗 2021-02-02 11:26

I\'ve a table with a popover for every cell as in the follow example:

the call to popover:



        
3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-02 12:23

    This solution for several ng-repeat popovers via isOpen field of popover's scope.

    angular.module('ui.bootstrap.demo', ['ui.bootstrap']).controller('PopoverDemoCtrl', function ($scope) {  
      $scope.template = 'myPopoverTemplate.html';
      $scope.close = function(e) {    
        angular.element(e.target).parent().parent().parent().parent().scope().$parent.isOpen = false;
      }
    });
    
    
    
    
    
    

提交回复
热议问题