getListeners
Retrieves a list of event listeners associated with a DOM element. The list does include host
listeners, but it does not include event listeners defined outside of the Angular context
(e.g. through addEventListener).
getListeners
Listener[]Retrieves a list of event listeners associated with a DOM element. The list does include host
listeners, but it does not include event listeners defined outside of the Angular context
(e.g. through addEventListener).
ElementElement for which the DOM listeners should be retrieved.
Listener[]Given the following DOM structure:
<app-root> <div (click)="doSomething()"></div></app-root>
Calling getListeners on <div> will return an object that looks as follows:
{ name: 'click', element: <div>, callback: () => doSomething(), useCapture: false}
Usage Notes
Given the following DOM structure:
<app-root> <div (click)="doSomething()"></div></app-root>
Calling getListeners on <div> will return an object that looks as follows:
{ name: 'click', element: <div>, callback: () => doSomething(), useCapture: false}