Debugging jQuery / angular event handlers in Chrome tools (getEventListeners)

We can use Chrome tools to test event listeners connected to specific DOM nodes. If we attach an event listener using JavaScript, we will see the attachment point at the output:

2277 document.addEventListener("click", click);

 

> getEventListeners(document)
< Objectclick: Array[1]
    0: Object
        listener: (e)
        ...
        [[FunctionLocation]]: exact_line.js:2277
        ...

However, when we use a binding Angular (jQuery) events, for example on, and offwe lose the anchor location (it seems to be lost in the call to jQuery / jqLite). How can we cancel the actual binding location?

2277 $document.on("click", click);

 

> getEventListeners(document)
< Objectclick: Array[1]
    0: Object
        listener: (a)
        ...
        [[FunctionLocation]]: jquery-1.11.1.min.js:3 (no idea)
        ...
+4
source share

Source: https://habr.com/ru/post/1661239/


All Articles