title: Angular directive to replace external links
body: <p>How can i create a custom filter to replace:</p>
  
  <pre><code>&lt;a href="http://www.externalsite.com"&gt;Whatever text&lt;/a&gt;
  </code></pre>
  
  <p>into this:</p>
  
  <pre><code>&lt;a href="#" ng-click="openExternal('http://www.externalsite.com')"&gt;Whatever text&lt;/a&gt;
  </code></pre>
  
  <p>it should be easy, but i'm unable to do it… I have this:</p>
  
  <pre><code>&lt;div ng-bind-html="item.htmltext | myFilter"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>and item.htmltext contains some  tags that i want to replace that way… How should i create myFilter to replace the links?</p>