I want to pass a javascript object that is already existed in a javascript file as a parameter to InvokeVoidAsync method :
myJs.js :
var myObject= {a:1,b:2};
MyComponent.razor :
@inject IJSRuntime js
@code {
private async Task MyMethod()
{
await js.InvokeVoidAsync("someJsFunction", /*how to add myObject here? */);
}
}
How to pass myObject to the someJsFunction function?
(Note that the function may also should accept c# objects too)