0

Say I have a table and ng-click is defined both at the row level and the individual cell level:

<table>
 <tbody>
  <tr ng-repeat="..."  ng-click="ctrl.action1()" >
    <td>
      <a class="..." ng-click="ctrl.action2()"><i class="..."></i></a>
    </td>
  </tr>
 </tbody>
</table>

Which one will be executed first, action1 or action2? Is the order guaranteed? Also parallel or sequential?

Ya.
  • 1,671
  • 4
  • 27
  • 53
  • 1
    you should check http://stackoverflow.com/a/4616720/594438 – Romulo Oct 08 '15 at 22:27
  • 1
    They will all trigger, starting with action2. You can stopPropagation though to prevent action1 from happening. But action2 will always happen. – Noitidart Oct 08 '15 at 22:29
  • Thanks Romulo and Notidart. I have a follow-up question here: http://stackoverflow.com/questions/33027344/is-there-a-way-to-force-ng-click-to-execute-first-on-parent-then-on-child – Ya. Oct 08 '15 at 23:03

0 Answers0