Skip to content

feat: route renderer events through Angular's EventManager - #177

Open
mukaschultze wants to merge 1 commit into
NativeScript:mainfrom
mukaschultze:feat/event-manager-plugin
Open

feat: route renderer events through Angular's EventManager#177
mukaschultze wants to merge 1 commit into
NativeScript:mainfrom
mukaschultze:feat/event-manager-plugin

Conversation

@mukaschultze

@mukaschultze mukaschultze commented Aug 11, 2026

Copy link
Copy Markdown

PR Checklist

What is the current behavior?

Nativescript Angular does not yet support angular's EventManagerPlugin

What is the new behavior?

Support for EventManagerPlugin, see https://angular.dev/guide/templates/event-listeners#extend-event-handling

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bcbec024-bdc3-40a7-ab07-ffd585da020c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Routes NativeScript renderer events through Angular’s EventManager, enabling custom event plugins.

Changes:

  • Adds and exports a default NativeScript event plugin.
  • Lazily delegates renderer listeners through EventManager.
  • Adds plugin routing and event behavior tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/angular/src/lib/public_api.ts Exports the plugin.
packages/angular/src/lib/nativescript.ts Registers event providers.
packages/angular/src/lib/nativescript-renderer.ts Delegates listener registration.
packages/angular/src/lib/nativescript-event-manager-plugin.ts Implements NativeScript event binding.
apps/nativescript-demo-ng/src/tests/event-manager-plugin.spec.ts Tests plugin behavior and integration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

return true;
}

addEventListener(element: unknown, eventName: string, handler: (data?: unknown) => void): VoidFunction {
Comment on lines +465 to +466
this.fallbackEventPlugin ??= new NativeScriptEventManagerPlugin();
return this.fallbackEventPlugin.addEventListener(target, eventName, modifiedCallback) as () => void;
Comment on lines +244 to +247
// EventManager must be resolved lazily: eager injection would instantiate
// every EVENT_MANAGER_PLUGINS provider while the renderer factory's own DI
// record is still circular, breaking plugins that inject RendererFactory2.
private eventManager: EventManager | null | undefined;
}
target.on(eventName, handler);
if (eventName === View.loadedEvent && target.isLoaded) {
// we must create a new obervable here to ensure that the event goes through whatever zone patches are applied
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants