Skip to content

EVENT_MANAGER_PLUGINS injection order #37850

@waterplea

Description

@waterplea

🐞 bug report

Affected Package

The issue is caused by package @angular/platform-browser

Is this a regression?

No

Description

If I provide my own EventManagerPlugins with multi token EVENT_MANAGER_PLUGINS in a module of my library, order of modules matters - if BrowserModule appears after my module in upmost App module then DomEventsPlugin is injected after my plugins and events never reach my plugins, see this line here:

https://github.com/angular/angular/blob/10.0.1/packages/platform-browser/src/dom/events/dom_events.ts#L20

🔬 Minimal Reproduction

https://stackblitz.com/edit/angular-event-plugins-bug

🔥 Exception or Error

No exceptions, plugins just never work

🌍 Your Environment

Angular Version:

Probably every version

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: coreIssues related to the framework runtimecore: event listeners

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions