I've the following code:
<table class="table">
<tr>
<th>Name___</th>
</tr>
<tr ng-repeat="app in apps"
ng-click="go('/editApp/' + plugin.name);">
<td>
<span>{{app.name}}</span>
</td>
<td style="width: 100px;">
<i class="glyphicon glyphicon-pencil"
ng-click="openPopup(app)"></i>
</td>
</tr>
</table>
When I click on the OpenPopup, also the go() method firing, how can I do that, If I click on popup just the popup will fire?
This executing because your <td>
nested in <tr>
, and click firstly fired openPopup()
then fired go()
. You can use $event.stopPropagation()
for stop event propagation to <tr>
.
Try
<table class="table">
<tr>
<th>Name___</th>
</tr>
<tr ng-repeat="app in apps"
ng-click="go('/editApp/' + plugin.name);">
<td>
<span>{{app.name}}</span>
</td>
<td style="width: 100px;">
<i class="glyphicon glyphicon-pencil"
ng-click="openPopup(app);$event.stopPropagation()"></i>
</td>
</tr>
</table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With