Ng-click in ng-click

<a class="item item-avatar" ng-repeat="item in result" ng-click="go('tab/profile/{{item.uid}}')">
<img src="{{item.picture}}" class="icon_top">
<button class="item-note button button-light button-small icon-left" ng-click="followButton()" ng-show="item.follow == 1"><i class="icon ion-checkmark-round"></i> {{'FOLLOW' | translate}}</button>
<button class="item-note button button-energized button-small icon-left" ng-click="followButton()" ng-hide="item.follow == 1">{{'FOLLOW' | translate}}</button>

Currently if someone clicks on the button it opens the go('tab/profile/{{item.uid}}') and the followButton()
How do I make only followButton() work?


I think you can use $event.stopPropagation() to stop the event from going from the button up to the <a>. Like this:

<button ng-click="followButton(); $event.stopPropagation()"></button>


Thank you!
Probably that event.preventDefault(); and return false; Not enough :smile:


Don’t make the item a link.

Just do :

<div class="item item-avatar" ng-repeat="item in result" ng-click="go('tab/profile/{{item.uid}}')">.....</div>


Okay :slight_smile:
It does not matter to me because I changed the ng-href tong-click (laziness to replace the a todiv)