DEV Community

Discussion on: Learn how YOU can use both C# and JavaScript in your Blazor app with the JavaScript interop

Collapse
 
ryanpd423 profile image
Ryan • Edited

Chris, great job mentioning that you can just inject IJSRuntime into your C# Class' constructor. Took me a while to figure that out on my own. I assumed I needed to register it the Startup.cs file, but I guess it is just auto-magically registered for you. Very helpful for folks trying to keep their component files code-free.

Great post.

Collapse
 
softchris profile image
Chris Noring

Thanks Ryan, happy it was helpful.