Created
November 14, 2022 15:24
-
-
Save jabed-web-dev/012d4434bfb8d86a8bd393e4b9c33a2d to your computer and use it in GitHub Desktop.
Revisions
-
jabed-web-dev created this gist
Nov 14, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ <h1>Counter</h1> <p role="status">Current count: @currentCount</p> <button class="btn btn-primary" @onclick="IncrementCount">Click me</button> @code { [Inject] public IJSRuntime JSRuntime { get; set; } = null!; public async void ConsoleLog(int arg) { await JSRuntime.InvokeVoidAsync("console.log", arg); } private int currentCount = 0; private void IncrementCount() { currentCount++; ConsoleLog(currentCount); } }