NG.I · Angular 22 practice question
A developer is implementing a custom event handler in Angular to introduce a debouncing mechanism for user input. To make this custom functionality available globally across the application's templates and host bindings, what is the required setup step?
Check answer and explanation
Correct answer: Provide the custom plugin class against the `EVENT_MANAGER_PLUGINS` token in the application's bootstrapping configuration.
Explanation
The source explicitly shows that the custom plugin must be registered by providing it against the `EVENT_MANAGER_PLUGINS` token during application bootstrapping.
Common trap
Defining a custom directive is an alternative approach but does not fulfill the requirement of creating a system-wide event plugin as described. Relying solely on an `@Input()` property limits the functionality to only the component that receives the input.
Source: Angular docs: Adding event listeners — Implementing Event Plugin
Checked against the cited text on 2026-11-25.