get original element from ng-click

后端 未结 2 1492
闹比i
闹比i 2020-11-28 02:29

I have a list of items in my view with ng-click attached to them:

相关标签:
2条回答
  • 2020-11-28 02:51

    You need $event.currentTarget instead of $event.target.

    0 讨论(0)
  • 2020-11-28 03:08

    Not a direct answer to this question but rather to the "issue" of $event.currentTarget apparently be set to null.

    This is due to the fact that console.log shows deep mutable objects at the last state of execution, not at the state when console.log was called.

    You can check this for more information: Consecutive calls to console.log produce inconsistent results

    0 讨论(0)
提交回复
热议问题