Created
February 12, 2019 04:31
-
-
Save NetanelBasal/4dff6419ee58c90f33b76c9cba54e8dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable() | |
export class EventManager { | |
constructor(@Inject(EVENT_MANAGER_PLUGINS) plugins: EventManagerPlugin[], private _zone: NgZone) { | |
plugins.forEach(p => p.manager = this); | |
this._plugins = plugins.slice().reverse(); | |
} | |
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function { | |
const plugin = this._findPluginFor(eventName); | |
return plugin.addEventListener(element, eventName, handler); | |
} | |
getZone(): NgZone { return this._zone; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment