title: Close popover clicking somewhere outside in angular
body: <p>I have something like this:</p>
  
  <p><a href="http://plnkr.co/edit/CoDdWWQz8jPPM4q1mhC5?p=preview" rel="nofollow">http://plnkr.co/edit/CoDdWWQz8jPPM4q1mhC5?p=preview</a></p>
  
  <p>What I would like to do is closing the popover window after clicking somewhere outside. I know that there were similar questions but I would like to know how to do that in Angular. Problem is, my popover is located inside script tag.</p>
  
  <pre><code>&lt;script type="text/ng-template" id="templateId.html"&gt;
    This is the content of the template {{name}}
  &lt;/script&gt;
  </code></pre>