Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve event listeners not correct when register outside of ngZone #33711

wants to merge 1 commit into from


Copy link

JiaLiPassion commented Nov 9, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #33687

When register event listener outside of ngZone, call triggerEventListener will not work because element.eventListeners will not have the registered event listener.

What is the new behavior?

element.eventListeners will have the registered event listener.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

In this PR, I removed the logic from DomEventsPlugin, because those logic are duplicate with zone.js implementation, those logic are for performance improvement at several months ago, but there is a bug, so the performance improvement in fact not working, so I created another PR here #20672, and it seems have several issues in G3, so now I would like to resolve this issue first and then continue to re-create the PR for performance improvement.

In this PR, there is no performance down because the logic deleted are the same in zone.js.

@JiaLiPassion JiaLiPassion requested a review from angular/fw-core as a code owner Nov 9, 2019
@googlebot googlebot added the cla: yes label Nov 9, 2019
@JiaLiPassion JiaLiPassion requested a review from angular/fw-integration as a code owner Nov 10, 2019
@JiaLiPassion JiaLiPassion force-pushed the JiaLiPassion:event-listeners branch from 460347d to 1b080c4 Nov 10, 2019
@JiaLiPassion JiaLiPassion changed the title WIP: fix event listeners bug fix: resolve event listeners not correct when register outside of ngZone Nov 10, 2019
@JiaLiPassion JiaLiPassion requested a review from mhevery Nov 10, 2019
@ngbot ngbot bot modified the milestone: needsTriage Nov 10, 2019

This comment has been minimized.

Copy link

mhevery commented Nov 11, 2019

Copy link

mhevery left a comment

❤️ it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.