Closed dajma00 closed 2 years ago
Did you add the service in the setup?
var appstate = new AppState(...);
var html = new ComponentRenderer<InvoiceView>()
.AddService<AppState>(appstate)
.Render();
I should point out that the component renderer can't plug directly into your Dependency Injection container. If you're calling it from a Controller you should inject the instance you need in the Controller's constructor so it's present when you execute the action.
Closed - no update
In our Blazor components, we frequently use dependency injection using the @inject or [Inject] attributes in C# code. When creating an HTML string, we get the following error in the console:
Otherwise the component works just fine. Is there a way around this?