title: How to close the dropdown when we click outside the menu in angularjs
body: <p>I am displaying dropdown menu when I click on an item. It is hiding when I click again on the item. I am trying to hide the dropdown menu if I click anywhere on the window. 
  Here is my code.</p>
  
  <pre><code>&lt;div  ng-click="showDropDown()" class="dropdown"&gt;dropDown
                      &lt;div id="myDropdown" class="dropdown-content"&gt;
                          &lt;label ng-click="sentToHome()"&gt;Home&lt;/label&gt;
                          &lt;label  ng-click="sentToContacts()"&gt;Contacts&lt;/label&gt;
                      &lt;/div&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>Here is my controller:</p>
  
  <pre><code>   $scope.showDropDown = function(){
  
         document.getElementById("myDropdown").classList.toggle("show"); 
      };
  </code></pre>
  
  <p>How to close the dropdown if I click anywhere in the page?</p>