跳到正文
本页尚未翻译成中文,以下为英文原文。 查看英文版

No event manager plugin found for event ​

This error occurs when Angular tries to set up a listener for an event but none of the registered event manager plugins recognizes the event name.

Debugging the error ​

The error message includes the unrecognized event name. It occurs only when no registered plugin supports the event, for example when an EventManager is created with a custom plugin list that does not include DomEventsPlugin, as in unit tests or custom setups.

If the event name is intentional and belongs to a third-party plugin (for example, a Hammer.js gesture event), make sure the plugin is provided via the EVENT_MANAGER_PLUGINS token:

ts
import {ApplicationConfig} from '@angular/core';
import {EVENT_MANAGER_PLUGINS} from '@angular/platform-browser';

export const appConfig: ApplicationConfig = {
  providers: [{provide: EVENT_MANAGER_PLUGINS, useClass: MyCustomPlugin, multi: true}],
};

基于 MIT 许可证发布。