Skip to content

Event handling with Blazor component inside Angular - not working #46604

@robert-skarzycki

Description

@robert-skarzycki

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Event handlers for Blazor component embedded in Angular app are not triggered.

I've created a Razor component and embedded it in Angular app as custom element. Component contains button that should trigger event handler that is passed as parameter to the component.
I'm trying pass event handler to the component, using kebab-style attribute, but the event is not triggered. I've tried different options, even using "wrapping" with Angular https://github.com/aspnet/samples/tree/main/samples/aspnetcore/blazor/JSComponentGeneration, but nothing helped.

Expected Behavior

Event handler is triggered when button is clicked. In attached repro repo, it should print something into browser's console.

Steps To Reproduce

You can find reproduction repository there: https://github.com/robert-skarzycki/blazor-component-in-angular

Exceptions (if any)

No response

.NET Version

7.0.102

Anything else?

No response

Metadata

Metadata

Assignees

Labels

✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyfeature-js-root-componentsIssues related to JS root components

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions