I have a span
tag that looks like this:
<span ng-bind-html="item.Name | linky" ng-click="open(item)"></span>
within an ng-repeat.
I have a problem though, if item.Name
contains an email or link the linky filter changes the html and inserts an anchor tag. Now when I click the link the ng-click fires AND the anchor opens, but I only want the anchor to open and prevent ng-click from being called ...is this possible?
How about something like this for your html:
And this for your function call:
There may be a better way but I believe this will work. Although it's in the documentation I saw
$event
in this group article.I don't know if this will work but give it a try.
Add a parameter to your open function and pass
this
as the pointer of current dom element.now in your open function EDITED CODE :
so the method will be called but will return false if it is the anchor tag.
This might not be what you want but it will serve your purpose :)
How about using a directive!
And with the restrict: 'E', you'll call it like this