0

I wrote the next code, but when I click on the trash icon, the ng-click of this element is thrown, but the ng-click of the div container is thrown too, I don't need the second one, just the first call, could some body help me.

  <div ng-if="order.selectedProducts === null || order.selectedProducts.length > 0"
    class="cartCol hoverable" ng-repeat="product in order.selectedProducts track by $index"
    ng-click="showProductDetailed(product)">
    <div class="cartHeading" ng-bind="product.name"></div>
    <a href="" class="trashIcon" ng-click="removeSelectedProduct(product);">
      <i class="fa fa-trash"></i>
    </a>
    <div class="cartSizeInfo">
      <span class="fltLft">{{product.productTypeName}}</span>
      <span class="fltRht">Bs. {{product.price}}</span>
    </div>
  </div>
MiltonCh
  • 11
  • 2

1 Answers1

1

I had to put $event.stopPropagation(); after the first call.

MiltonCh
  • 11
  • 2
  • sometimes it may create another issue - say tooltip is not closed after clicking trash icon since listener is attached to – skyboyer Jan 07 '18 at 05:46