W3cubDocs

/Angular

EventManager

An injectable service that provides event management for Angular through a browser plug-in.

API

class EventManager {
  constructor(plugins: EventManagerPlugin[], _zone: NgZone): EventManager;
  addEventListener(element: HTMLElement, eventName: string, handler: Function, options?: ListenerOptions | undefined): Function;
  getZone(): NgZone;
}

constructor

EventManager

Initializes an instance of the event-manager service.

@parampluginsEventManagerPlugin[]
@param_zoneNgZone
@returnsEventManager

addEventListener

Function

Registers a handler for a specific element and event.

@paramelementHTMLElement

The HTML element to receive event notifications.

@parameventNamestring

The name of the event to listen for.

@paramhandlerFunction

A function to call when the notification occurs. Receives the event object as an argument.

@paramoptionsListenerOptions | undefined

Options that configure how the event listener is bound.

@returnsFunction

getZone

NgZone

Retrieves the compilation zone in which event listeners are registered.

@returnsNgZone

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/platform-browser/EventManager