Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to import a blazor custom element in another JS application?

$
0
0

I have a blazor server app, with a registered custom element as below code:

builder.Services.AddServerSideBlazor(options =>{    options.RootComponents.RegisterAsCustomElement<Counter>("my-blazor-counter");});

I want to import this blazor custom element in another node.js application to convert it into a lit element(web component).I have added below scripts in my node.js app

<script src="https://localhost:7075/_framework/blazor.server.js"></script><script src="https://localhost:7075/_content/Microsoft.AspNetCore.Components.CustomElements/BlazorCustomElements.js"></script>

but while initializing the Blazor it still using node app port and failing while initialization.I am not sure I am missing anything here or if there is any other way to do it.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>