removeAllListeners() seems to remove both events registered using addEventListener() and ones added by setting the on<event> properties. However, it leaves things in an inconsistent state, since the value of the on<event> property remains the same, even though the actual event listener is removed, and the handler now never gets called.
document.onclick = () => console.log('click');
// After calling this, the listener above is removed, and clicking on
// the document does nothing.
document.removeAllListeners();
// The 'onclick' property still contains the old event listener.
console.log(document.onclick);
console.log(document[Zone.__symbol__('ON_PROPERTYclick')]);
removeAllListeners()seems to remove both events registered usingaddEventListener()and ones added by setting theon<event>properties. However, it leaves things in an inconsistent state, since the value of theon<event>property remains the same, even though the actual event listener is removed, and the handler now never gets called.