Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsakamoto/toolbelt.blazor.getproperty.script
Add a tiny JavaScript function out-of-the-box to get JavaScript property values in your Blazor apps.
https://github.com/jsakamoto/toolbelt.blazor.getproperty.script
blazor javascript-interop
Last synced: about 2 months ago
JSON representation
Add a tiny JavaScript function out-of-the-box to get JavaScript property values in your Blazor apps.
- Host: GitHub
- URL: https://github.com/jsakamoto/toolbelt.blazor.getproperty.script
- Owner: jsakamoto
- License: mpl-2.0
- Created: 2023-07-04T11:34:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-16T21:48:13.000Z (about 1 year ago)
- Last Synced: 2024-10-28T12:38:03.170Z (2 months ago)
- Topics: blazor, javascript-interop
- Language: CSS
- Homepage:
- Size: 48.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Blazor GetProperty Script [![NuGet Package](https://img.shields.io/nuget/v/Toolbelt.Blazor.GetProperty.Script.svg)](https://www.nuget.org/packages/Toolbelt.Blazor.GetProperty.Script/)
## Summary
Once you've installed this NuGet package to your Blazor application,
```shell
dotnet add package Toolbelt.Blazor.GetProperty.Script
```you can use the **`Toolbelt.Blazor.getProperty`** global JavaScript function in your Blazor application. The **`Toolbelt.Blazor.getProperty`** allows you to retrieve any global property values specified by dot-separated property path string without any additional installations and configurations, like below.
```razor
@inject IJSRuntime JSRuntime@code
{
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
var onLine = await JSRuntime.InvokeAsync("Toolbelt.Blazor.getProperty", "navigator.onLine");
}
}
}
```## Release Note
[Release notes](https://github.com/jsakamoto/Toolbelt.Blazor.GetProperty.Script/blob/main/RELEASE-NOTES.txt)
## License
[Mozilla Public License Version 2.0](https://github.com/jsakamoto/Toolbelt.Blazor.GetProperty.Script/blob/main/LICENSE)