You can do something like this:
.directive('popoverCont', function() {
  popController.$inject = ['$element'];
  return {
    restrict: 'E',
    templateUrl: 'template_popover.html',
    controller: popController,
    controllerAs: "$ctrl"
  };
  
  function popController($element) {
    // use a bit of hackery to fetch the element that contains te popover 
itself
    var popover = $element[0].parentNode.parentNode.querySelector(
'[custom-popover]');
    var close =  $element[0].querySelector('#closePop'); // get the button
    close.addEventListener('click', function () {
      console.log('closing on button')
      // this is not working, it looks like the popover prevents clicks.
    })
    console.log('crtl', popover, close)
    document.addEventListener('click', function () {
      console.log('closing from document')
      // do whatever to close the popover..
    })
  }
});


Hope this helps you a tad,
Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to