BlazorJsManager 1.0.9
dotnet add package BlazorJsManager --version 1.0.9
NuGet\Install-Package BlazorJsManager -Version 1.0.9
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlazorJsManager" Version="1.0.9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlazorJsManager" Version="1.0.9" />
<PackageReference Include="BlazorJsManager" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BlazorJsManager --version 1.0.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BlazorJsManager, 1.0.9"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=BlazorJsManager&version=1.0.9
#tool nuget:?package=BlazorJsManager&version=1.0.9
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
blazor-js-manager
Latest version:
Status:
Small package that adds services that make managing and invoking JS scripts in Blazor a breeze.
Features
- Simple JS module loading and invocation for Blazor (WASM & Server)
- Dependency injection for JS modules
- Type-safe JS interop
- Automatic module disposal
Installation
Install via NuGet:
dotnet add package BlazorJsManager
Usage
- Register services in your
Program.cs
:
builder.Services.AddJsModuleResolver();
- Inject and use the resolver in your component or service:
@inject IJsModuleResolver JsModuleResolver
@code {
private IJSObjectReference? _module;
protected override async Task OnInitializedAsync()
{
_module = await JsModuleResolver.ResolveAsync("myModule");
await _module.InvokeVoidAsync("myJsFunction");
}
}
- Options: You can configure options via
AddJsModuleResolver(configure: options => { ... })
.
API
IJsModuleResolver.ResolveAsync(string path)
– Loads a JS module and returns anIJSObjectReference
.- Extension methods for common scenarios (see source for details).
License 
See License for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.5)
- Microsoft.Extensions.Options (>= 9.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.5)
- Microsoft.JSInterop (>= 9.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.