title: closing dropdown single or multiselect when clicking outside
body: <p>I am trying close my drop downs which are multiselect. below is the code I am trying :</p>
  
  <pre><code>element.bind('click', function (event) {
      event.stopPropagation();
  });
  
  $document.bind('click', function () {
      $scope.opened = false;
      $scope.$apply();
  });
  </code></pre>
  
  <p>but once I click outside the drop down window. one click is triggering multiple click event and for each click below block of code is getting called n number of times like = 40, 90 etc I guess it is equal to number of element in the window:</p>
  
  <pre><code>$document.bind('click', function () {
      $scope.opened = false;
      $scope.$apply();
  });
  </code></pre>
  
  <p>I tried even <code>event.stopPropagation()</code> just after document.bind but it did not work.</p>
  
  <p>These chunk of code I have written inside the link function of directive which I created for multiselect. </p>