I'm new to MatBlazor and decided to try it out as it has 300K + downloads on Nuget. 👍
I got the MatProgressBar component working easy enough in the FetchData Blazor sample that comes with Visual Studio.
But when I tried the MatTable component on the same sample I get this error which doesn't make sense as I'm not making any HTTP calls:
InvalidOperationException: Cannot provide a value for the 'Http' property on type MatBlazor.MatTable...There is no registered service of type 'System.Net.Http.HttpClient'.
Here is the code
<MatTable Items="@forecasts" LoadInitialData="true"> <MatTableHeader> <th>Date</th> <th>Temp. (C)</th> <th>Temp. (F)</th> <th>Summary</th> </MatTableHeader> <MatTableRow> <td>@context.Date.ToShortDateString()</td> <td>@context.TemperatureC</td> <td>@context.TemperatureF</td> <td>@context.Summary</td> </MatTableRow> </MatTable>
Any help would be appreciated.
Apologies as I forgot to specify the solution for anyone else who runs into the same issue (See my earlier post dated 30 December 2020 @ 14:56 hours)
This is applicable to Blazor Server projects only.
In the ConfigureServices method of the Startup class, include the following line of code:
Is there a way to deal with timezones in the MatDatePicker component? What shows correctly in a normal input gets borked by a difference in local time and utc. The TimeZoneKit seems deprecated and no longer available on Nuget. I found someone writing about fiddling with what's returned server side, but it doesn't seem like a great idea to me because it displays correctly in normal html input. Example: