Skip to content

jsakamoto/Toolbelt.Blazor.GetProperty.Script

Repository files navigation

Blazor GetProperty Script NuGet Package

Summary

Once you've installed this NuGet package to your Blazor application,

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.

@inject IJSRuntime JSRuntime

@code
{
  protected override async Task OnAfterRenderAsync(bool firstRender)
  {
    if (firstRender)
    {
      var onLine = await JSRuntime.InvokeAsync<bool>("Toolbelt.Blazor.getProperty", "navigator.onLine");
    }
  }
}

Release Note

Release notes

License

Mozilla Public License Version 2.0

About

Add a tiny JavaScript function out-of-the-box to get JavaScript property values in your Blazor apps.

Topics

Resources

License

Stars

Watchers

Forks

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy