将点击的元素 href 作为参数传递给 ng-click

pass clicked elements href as a parameter in ng-click

我不知道如何做这样的事情:

<a href="http://google.com" ng-click="myFunc(this.href)">Link</a>

所以基本上我想将点击的 link 的 href 作为参数传递给 myFunc

试试这个

<a href="http://google.com/" ng-click="myFunc($event.target.href)">Link</a>

Example