-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed as duplicate of#61684
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
I am trying to load a Components JS isolation file in a simple way without hard code its location but I have to hardcode the path to the JSInvoke "Import" function.
module = await JS.InvokeAsync<IJSObjectReference>("import",
"./Components/Pages/AlertUser.razor.js");"
It would be nice if the component( or the JS runtime) knows the js File location and load it.
Describe the solution you'd like
one solution could be that the component load the IS modul
_jsModule = await this.LoadComponentJSModueAsync(JSRuntime);
or visa verse , the JSRunntime can do it
` _jsModule = await JSRunntime.LoadComponentJSModueAsync(this);
Additional context
sometimes during development components move from on package or directory to another. A hardcoded import path has always been to update. From a helicopter view js isolation it should have the same behaviour than CSS isolation
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components